9f5626bd1944d27eaaf2281c48f50cf8e9879a1b
- Author
- Jonah Bernhard <jonah.bernhard@gmail.com>
- Committer
- Jonah Bernhard <jonah.bernhard@gmail.com>
- Date
Message
Add option to remove old log files.
Diff
1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
2index 92535b9d24580e3aae9135b21339cd339b87bbfa..c5f6e749e599966cc5a4958db027029341435f32 100755
3--- a/duplicity-backup.sh
4+++ b/duplicity-backup.sh
5@@ -730,6 +730,10 @@ echo -e "-------- END DUPLICITY-BACKUP SCRIPT --------\n" >> ${LOGFILE}
6
7 email_logfile
8
9+# remove old logfiles
10+# stops them from piling up infinitely
11+[[ -n "${REMOVE_LOGS_OLDER_THAN}" ]] && find ${LOGDIR} -type f -mtime +"${REMOVE_LOGS_OLDER_THAN}" -delete
12+
13 if [ ${ECHO} ]; then
14 echo "TEST RUN ONLY: Check the logfile for command output."
15 fi