Update 'duplicacy.sh'

This commit is contained in:
2019-12-04 15:02:56 -05:00
parent e1bb2037f0
commit 605ecd8a4a

View File

@@ -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_<STORAGENAME>_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}