From 20ded180e8cd53a3c03c71456ade9cc8a9a72183 Mon Sep 17 00:00:00 2001 From: Matt Dirba Date: Mon, 13 Apr 2015 17:13:08 -0500 Subject: [PATCH] Appending usage information to EMAIL_SUBJECT modified: duplicity-backup.sh --- duplicity-backup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100755 => 100644 duplicity-backup.sh diff --git a/duplicity-backup.sh b/duplicity-backup.sh old mode 100755 new mode 100644 index 44bab45..58eb713 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -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-`