From 605ecd8a4a00faac8aaa9525f87c282c6838de4d Mon Sep 17 00:00:00 2001 From: jgaunt Date: Wed, 4 Dec 2019 15:02:56 -0500 Subject: [PATCH] Update 'duplicacy.sh' --- duplicacy.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/duplicacy.sh b/duplicacy.sh index f0519e9..57b95c1 100644 --- a/duplicacy.sh +++ b/duplicacy.sh @@ -16,14 +16,12 @@ echo $$ > ${lockfile} # run the backup for folder in ${FOLDERS_TO_BACKUP[@]}; do - # removes the slashes and replaces with a dash - id=${HOST}${folder////-} cd ${folder} if [ -d "${folder}/.duplicacy" ]; then duplicacy -verbose -log backup -stats >> ${LOGFILE} 2>&1 - # compress the logs - gzip $(dirname ${LOGFILE})/*.log else + # removes the slashes and replaces with a dash + id=${HOST}${folder////-} # sftp password DUPLICACY_SSH_PASSWORD DUPLICACY__SSH_PASSWORD ssh_password echo "Please enter duplicacy ssh password" read -s SSH_PASSWORD @@ -34,5 +32,8 @@ for folder in ${FOLDERS_TO_BACKUP[@]}; do fi done +# compress the logs +gzip $(dirname ${LOGFILE})/*.log + # clean up lockfile rm -f ${lockfile} \ No newline at end of file