Appending usage information to EMAIL_SUBJECT

modified:   duplicity-backup.sh
This commit is contained in:
Matt Dirba 2015-04-13 17:13:08 -05:00
parent a749d24901
commit 20ded180e8

6
duplicity-backup.sh Executable file → Normal file
View file

@ -401,8 +401,10 @@ get_remote_file_size()
"ss")
TMPDEST="${DEST#*://*/}"
TMPDEST="${DEST%/${TMPDEST}}"
ssh_opt=`echo $STATIC_OPTIONS |perl -ne 'print "-i $1" if (/IdentityFile=
SIZE=`${TMPDEST%://*} ${ssh_opt} ${TMPDEST#*//} du -hs ${DEST#${TMPDEST}/
ssh_opt=`echo $STATIC_OPTIONS |perl -ne 'print "-i $1" if (/IdentityFile="?([^"]*)/);'`
SIZE=`${TMPDEST%://*} ${ssh_opt} ${TMPDEST#*//} du -hs ${DEST#${TMPDEST}/} | awk '{print $1}'` 2>> ${LOGFILE}
EMAIL_SUBJECT="$EMAIL_SUBJECT $SIZE `${TMPDEST%://*} ${ssh_opt} ${TMPDEST#*//} df -hP ${DEST#${TMPDEST}/} | awk '{tmp=$5 " used"}END{print tmp}'`" 2>> ${LOGFILE}
;;
"fi")
TMPDEST=`echo ${DEST} | cut -c 6-`