Added ftp backup script
This commit is contained in:
parent
50116fd19f
commit
ef841499f7
@ -9,7 +9,10 @@ RUN TF=`mktemp` &&\
|
||||
|
||||
EXPOSE 35621/TCP 35622/UDP 35623/TCP
|
||||
|
||||
COPY prefilebackup /usr/local/etc/urbackup/
|
||||
RUN chmod 0700 /usr/local/etc/urbackup/prefilebackup
|
||||
|
||||
WORKDIR /app
|
||||
COPY run.sh /app
|
||||
COPY run.sh /app/
|
||||
|
||||
CMD ["sh", "run.sh"]
|
||||
|
25
prefilebackup
Normal file
25
prefilebackup
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -z "$DO_FTP_BACKUP" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# DISTANT DIRECTORY
|
||||
REMOTE_DIR="/"
|
||||
|
||||
#LOCAL DIRECTORY
|
||||
LOCAL_DIR="/backup"
|
||||
|
||||
# RUNTIME!
|
||||
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
|
Reference in New Issue
Block a user