From ab54eb4c428b767732b778fc33a31b86b291a249 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 13 Jul 2018 23:07:33 +0100 Subject: [PATCH] etc/cron.weekly/clean-dirs --- etc/cron.weekly/clean-dirs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/etc/cron.weekly/clean-dirs b/etc/cron.weekly/clean-dirs index 0b9e7a38..f2a12700 100755 --- a/etc/cron.weekly/clean-dirs +++ b/etc/cron.weekly/clean-dirs @@ -2,7 +2,7 @@ ################################################################################# # # NB 06.07.13 -# Delete unused files +# Delete old files # # To test: touch -t '190001010000' /tmp/todel && ls -lh /tmp/todel # @@ -13,8 +13,9 @@ DIRS="\ /var/tmp/ \ ~root/tmp/ /{home,Users}/*/tmp/ \ +/{home,Users}/*/Maildir/.Junk/cur/ \ +/{home,Users}/*/Maildir/{.Trash,.Trash.*}/cur/ \ /{home,Users}/*/{ownCloud,Dropbox,Google\ Drive}/tmp/ \ -/Users/*/.Trash/ \ " LOCATE=" @@ -26,10 +27,14 @@ LOCATE=" /home/share/Music/*desktop.ini /kodi_crashlog-* " - -################################################################################# DEBUG=0 LOG="/var/log/clean-dirs.log" + +ENABLE=yes +[ -r /etc/default/clean-dirs ] && . /etc/default/clean-dirs +[ "$ENABLE" = "yes" ] || exit 0 + +################################################################################# while [ $# -gt 0 ]; do case "$1" in -- 2.47.3