Update 'duplicacy.sh'

This commit is contained in:
2019-12-04 16:51:23 -05:00
parent 8b3aa0d206
commit e6f007f170

View File

@@ -21,17 +21,18 @@ for folder in ${FOLDERS_TO_BACKUP[@]}; do
duplicacy -verbose -log backup -stats >> ${LOGFILE} 2>&1 duplicacy -verbose -log backup -stats >> ${LOGFILE} 2>&1
else else
# removes the slashes and replaces with a dash # removes the slashes and replaces with a dash
id=${HOST}${folder////-} id=${HOST}$(echo $folder | sed 's/\//-/g')
# sftp password DUPLICACY_SSH_PASSWORD DUPLICACY_<STORAGENAME>_SSH_PASSWORD ssh_password # sftp password DUPLICACY_SSH_PASSWORD DUPLICACY_<STORAGENAME>_SSH_PASSWORD ssh_password
echo "Please enter duplicacy ssh password" if [ ${SSH_PASSWORD} == '' ]; then
read -s SSH_PASSWORD echo "Please enter duplicacy ssh password"
export DUPLICACY_SSH_PASSWORD=${SSH_PASSWORD} read -s SSH_PASSWORD
export DUPLICACY_SSH_PASSWORD=${SSH_PASSWORD}
fi
duplicacy init ${id} sftp://duplicacy@gauntnas.home.johnhgaunt.com//mnt/data-pool/backups/duplicacy/data duplicacy init ${id} sftp://duplicacy@gauntnas.home.johnhgaunt.com//mnt/data-pool/backups/duplicacy/data
duplicacy set -key ssh_password -value "${SSH_PASSWORD}" duplicacy set -key ssh_password -value "${SSH_PASSWORD}"
SSH_PASSWORD=''
fi fi
done done
SSH_PASSWORD=''
# compress the logs # compress the logs
gzip $(dirname ${LOGFILE})/*.log gzip $(dirname ${LOGFILE})/*.log