feat: enable ftp backups

This commit is contained in:
Michael Mandl 2023-08-24 10:58:04 +02:00
parent d565465665
commit 9547f357ce
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
2 changed files with 8 additions and 12 deletions

View file

@ -1,7 +1,7 @@
FROM kopia/kopia FROM kopia/kopia
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y cron postgresql-client && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y cron postgresql-client lftp && rm -rf /var/lib/apt/lists/*
ARG KOPIA_CRON_SCHEDULE ARG KOPIA_CRON_SCHEDULE
ENV KOPIA_CRON_SCHEDULE ${KOPIA_CRON_SCHEDULE} ENV KOPIA_CRON_SCHEDULE ${KOPIA_CRON_SCHEDULE}

View file

@ -8,17 +8,13 @@ then
PGPASSWORD=$KOPIA_PG_PASSWORD pg_dump --host=$KOPIA_PG_HOST --username=$KOPIA_PG_USER $KOPIA_PG_DATABASE > /backup/database/$KOPIA_PG_DATABASE.sqldump || exit 1 PGPASSWORD=$KOPIA_PG_PASSWORD pg_dump --host=$KOPIA_PG_HOST --username=$KOPIA_PG_USER $KOPIA_PG_DATABASE > /backup/database/$KOPIA_PG_DATABASE.sqldump || exit 1
fi fi
# if [[ -v KOPIA_FTP_HOST ]]; if [[ -v KOPIA_FTP_HOST ]];
# then then
# echo "Downloading from ftp server ${KOPIA_FTP_HOST}" echo "Downloading from ftp server ${KOPIA_FTP_HOST}"
#
# lftp -u "$KOPIA_FTP_USER","$KOPIA_FTP_PASSWORD" $KOPIA_FTP_HOST <<EOF lftp -u "$KOPIA_FTP_USER","$KOPIA_FTP_PASSWORD" -e "set ssl:verify-certificate no; mirror --delete --parallel=4 --use-pget-n=10 / /backup/ftp;" $KOPIA_FTP_HOST || exit 1
# set ssl:verify-certificate no fi
# mirror --delete --parallel=4 --use-pget-n=10 / /backup/ftp;
# exit
# EOF || exit 1
# fi
#
kopia repository connect filesystem \ kopia repository connect filesystem \
--path /repository \ --path /repository \
--override-hostname ${KOPIA_HOSTNAME} \ --override-hostname ${KOPIA_HOSTNAME} \