From 033202a6a4fb85bbd5afc0f06e0f54d405831e3a Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Mon, 3 Feb 2020 20:46:25 +0100 Subject: [PATCH] Moved ftp backup to external script file --- Dockerfile | 4 ++-- prefilebackup => scripts/ftp_backup.sh | 10 +--------- scripts/prefilebackup | 6 ++++++ 3 files changed, 9 insertions(+), 11 deletions(-) rename prefilebackup => scripts/ftp_backup.sh (72%) create mode 100644 scripts/prefilebackup diff --git a/Dockerfile b/Dockerfile index 38c02c2..7a5d9d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ RUN TF=`mktemp` &&\ EXPOSE 35621/TCP 35622/UDP 35623/TCP -COPY prefilebackup /usr/local/etc/urbackup/ -RUN chmod 0700 /usr/local/etc/urbackup/prefilebackup +COPY scripts/* /usr/local/etc/urbackup/ +RUN chmod 0700 /usr/local/etc/urbackup/* WORKDIR /app COPY run.sh /app/ diff --git a/prefilebackup b/scripts/ftp_backup.sh similarity index 72% rename from prefilebackup rename to scripts/ftp_backup.sh index f450220..be95be9 100644 --- a/prefilebackup +++ b/scripts/ftp_backup.sh @@ -1,16 +1,8 @@ #!/usr/bin/env bash -if [[ -z "$DO_FTP_BACKUP" ]]; then - exit 0 -fi - -# DISTANT DIRECTORY REMOTE_DIR="/" +LOCAL_DIR="/backup/ftp" -#LOCAL DIRECTORY -LOCAL_DIR="/backup" - -# RUNTIME! echo echo "Starting download $REMOTE_DIR from $FTP_HOST to $LOCAL_DIR" date diff --git a/scripts/prefilebackup b/scripts/prefilebackup new file mode 100644 index 0000000..70de866 --- /dev/null +++ b/scripts/prefilebackup @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +if [[ -z "$DO_FTP_BACKUP" ]]; then + sh ftp_backup.sh +fi +