Moved ftp backup to external script file

This commit is contained in:
Michael Mandl 2020-02-03 20:46:25 +01:00
parent ef841499f7
commit 033202a6a4
3 changed files with 9 additions and 11 deletions

17
scripts/ftp_backup.sh Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
REMOTE_DIR="/"
LOCAL_DIR="/backup/ftp"
echo
echo "Starting download $REMOTE_DIR from $FTP_HOST to $LOCAL_DIR"
date
lftp -u "$FTP_USER","$FTP_PASSWORD" $FTP_HOST <<EOF
set ssl:verify-certificate no
mirror --delete --parallel=4 --use-pget-n=10 $REMOTE_DIR $LOCAL_DIR;
exit
EOF
echo
echo "Transfer finished"
date

6
scripts/prefilebackup Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
if [[ -z "$DO_FTP_BACKUP" ]]; then
sh ftp_backup.sh
fi