From: Don Armstrong Date: Sun, 12 Mar 2006 01:53:34 +0000 (+0000) Subject: Modify getmail to have it delete old mailboxes X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c7100e38348b3724a15f6c5114aa8ce7f1993949;p=bin.git Modify getmail to have it delete old mailboxes --- diff --git a/getmail b/getmail index 62a1ce0..ec6f12d 100755 --- a/getmail +++ b/getmail @@ -23,7 +23,10 @@ if [ -z "$CRON" ] || kill -0 `pgrep -U $(id -u) -x $MUA` 2>/dev/null; then for account in bugs lists; do find /home/don/Mail/$account -maxdepth 1 -mindepth 1 -type d \ -exec sh -c 'test $(find {} -type f |wc -l) -eq 0' ';' \ - -printf '%f\000'|xargs -0 -n 1 ~/bin/deletemailbox -a $account >/dev/null + -printf '%f\000'|xargs -0 -n 1 ~/bin/deletemailbox -a $account >/dev/null; + find /home/don/Mail/$account -maxdepth 2 -mindepth 2 -iname 'new' \ + -type d -ctime +60 -printf '%h\n'|xargs -n 1 basename|xargs \ + -n 1 /home/don/bin/deletemailbox -a $account >/dev/null; done; fi; fi;