bunch of updates and fixes
[distro-setup] / mailclean
index 753529ef3d9a095d37b1a2c9370346558faf468e..04c8f9da39236d02b414930c507c88bdbe34e286 100755 (executable)
--- a/mailclean
+++ b/mailclean
@@ -28,10 +28,11 @@ myfind() {
 # qemu-devel is our biggest list by far, so occasionally
 # I want to hop into conversations about our mailing
 # systems there, but I don't need many old messages.
-myfind /nocow/user/fsfmd/l/qemu-devel/new -type f -mtime +14 -execdir rm -- '{}' +
-myfind /nocow/user/fsfmd/{sec,Spam,Drafts,{rtcc,sysadmin,l/outreachy-mentors}/new} -type f -mtime +100 -execdir rm -- '{}' +
-myfind /nocow/user/fsfmd/log -type f -mtime +300 -execdir rm -- '{}' +
-myfind /nocow/user/fsfmd/dmarc -type f -mtime +14 -execdir rm -- '{}' +
+myfind /m/md/l/qemu-devel/new -type f -mtime +14 -execdir rm -- '{}' +
+myfind /m/md/{sec,Spam,Drafts,{rtcc,sysadmin,l/outreachy-mentors}/new} -type f -mtime +100 -execdir rm -- '{}' +
+myfind /m/md/log -type f -mtime +300 -execdir rm -- '{}' +
+myfind /m/md/dmarc -type f -mtime +14 -execdir rm -- '{}' +
+myfind /m/md/fsfalerts -type f -mtime +10 -execdir rm -- '{}' +
 
 
 
@@ -44,14 +45,15 @@ for d in ./!(*archive|Drafts)/*(cur|new) ./l/!(*archive)/*(cur|new); do
   madearchive=false
   leafdir=${d##*/}
   md=${d%/*}; md=${md##*/}
-  archive=${d%/*/*}/${md}-myarchive/$leafdir
-  archivebase=archive=${d%/*/*}/${md}-myarchive
+  archivebase=${d%/*/*}/${md}-myarchive
+  archive=$archivebase/$leafdir
   for f in $d/1*; do
     date=$($scriptdir/email-date.py $f) || echo $f
     [[ $date ]] || continue
     if (( date < now - 60*60*24*400 )); then
       if ! $madearchive; then
-        mkdir -p ${archivebase}{cur,tmp,new}
+        echo mkdir -p ${archivebase}/{cur,tmp,new}
+        mkdir -p ${archivebase}/{cur,tmp,new}
         madearchive=true
       fi
       mv $f $archive