From b20f7ab687ae5160c11e5ecb6edead044039c81c Mon Sep 17 00:00:00 2001 From: Jonah Bernhard Date: Sun, 30 Mar 2014 14:43:53 -0400 Subject: [PATCH 1/3] Clarification when remote size unavailable. --- duplicity-backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 3123510..95269f4 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -394,7 +394,7 @@ get_remote_file_size() fi ;; *) - SIZE="Information on remote file size unavailable." + SIZE="unsupported by backend" ;; esac From 36f87c73f15979f0f5d7108aed0cca4b962890fa Mon Sep 17 00:00:00 2001 From: Jonah Bernhard Date: Sun, 30 Mar 2014 14:44:17 -0400 Subject: [PATCH 2/3] Only change log file ownership if necessary. --- duplicity-backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 95269f4..92535b9 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -505,7 +505,8 @@ EOF sed -i -e '/^--*$/d' ${LOGFILE} ;; esac - chown ${LOG_FILE_OWNER} ${LOGFILE} + + [[ -n "${LOG_FILE_OWNER}" ]] && chown ${LOG_FILE_OWNER} ${LOGFILE} } backup_this_script() From 9f5626bd1944d27eaaf2281c48f50cf8e9879a1b Mon Sep 17 00:00:00 2001 From: Jonah Bernhard Date: Sun, 30 Mar 2014 14:44:31 -0400 Subject: [PATCH 3/3] Add option to remove old log files. --- duplicity-backup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 92535b9..c5f6e74 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -730,6 +730,10 @@ echo -e "-------- END DUPLICITY-BACKUP SCRIPT --------\n" >> ${LOGFILE} email_logfile +# remove old logfiles +# stops them from piling up infinitely +[[ -n "${REMOVE_LOGS_OLDER_THAN}" ]] && find ${LOGDIR} -type f -mtime +"${REMOVE_LOGS_OLDER_THAN}" -delete + if [ ${ECHO} ]; then echo "TEST RUN ONLY: Check the logfile for command output." fi