7 for folder
in $
(find ~
/Maildir ~
/Maildir
/.
* -maxdepth 0 -type d
-not -name ..
-not -name .Drafts
-not -name '.Gmail*' -not -name '.Technotes.Drafts') ~
/Maildir
/.Gmail.
[Gmail
].All_Mail
; do
8 dest
=$
(basename $folder |
sed 's/^\.//')
9 # Let's get rid of trash
10 if [[ $dest =~ rash$
]]; then
11 archivemail
-d30 --delete $folder
13 if [ "$dest" = "" ] ||
[ "$dest" = "Maildir" ]; then
17 #let's archive read mail over 7 days
18 archivemail
-u -d8 -o $dest --archive-name=$date $folder
21 # let's delete mailing list mail that is older than 60 days. If I haven't read
22 # by then, I probably won't :)
23 for folder
in $
(find ~
/Maildir ~
/Maildir
/.
* -maxdepth 0 -type d
-name '.debian.*' )
25 archivemail
-d60 --delete $folder
28 for dir
in $
(find -maxdepth 1 -mindepth 1 -type d
-not -name .git
); do
29 # Compress mail not compressed by archivemail
30 find $dir -maxdepth 1 -type f
-regex '.*/[0-9]*-[0-9]*$' -exec gzip -9 {} \
;
32 # Either check in old archives, or delete them after a month.
33 if [ -n "$(git log -n 1 -- "$dir")" ]; then
34 git add
-f $
(find $dir -maxdepth 1 -type f
-regex '.*/[0-9]*-[0-9]*.gz') 2>/dev
/null || true
36 find $dir -maxdepth 1 -type f
-mtime +31 -exec rm -f {} \
; >&2
40 if ! git commit
-q -a -m"autocommit"; then
41 echo "git commit failed" >&2
43 elif ! git push
2>/dev
/null
; then
44 echo "git push failed" >&2