From 9f5626bd1944d27eaaf2281c48f50cf8e9879a1b Mon Sep 17 00:00:00 2001 From: Jonah Bernhard Date: Sun, 30 Mar 2014 14:44:31 -0400 Subject: [PATCH] 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