]> git.nbdom.net Git - nb.git/commitdiff
etc/cron.weekly/clean-dirs
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 13 Jul 2018 22:07:33 +0000 (23:07 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 13 Jul 2018 22:07:33 +0000 (23:07 +0100)
etc/cron.weekly/clean-dirs

index 0b9e7a380b7420a218b321944ce8007177fa0293..f2a12700907d29b2f16660583efc7004d883c511 100755 (executable)
@@ -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