Re: [exim-dev] Automatically removing old mail

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Michael Haardt
Ημερομηνία:  
Προς: exim-dev
Αντικείμενο: Re: [exim-dev] Automatically removing old mail
> That seems a lot like overkill when a simple one line command stuck in
> cron does it just fine.
>
> # Anything over 14 days old
> find . -type f -mtime +14 -exec rm {} \;
> # Anything over 1Mb and 2 days old
> find . -type f -mtime +2 -size 1000k -exec rm {} \;
>
> Why re-invent the wheel? You're always going to deliver the message so
> it's not really in Exim's domain.


You could at least have used -o to merge both runs and -print0 of GNU
find together with GNU xargs.

Then, use the same regex as Exim to follow folders. You are just removing
maildirsize files and vacation databases - not good. The script is not
folder-specific, but of course you could parse the expire files, hacking
find a little to change parameters per directory. Then you still have
the problem of scanning many folders that are unchanged. Add checking
timestamps and the like to speed it up. A sequential approach makes poor
use of a RAID, so you use multiple processes for parallel I/O. Ugly,
but works. If only the load peak would not disturb the system now,
so you need to make sure I/O is spread a little more, tuning it per RAID.

Cleaning up as part of delivery has a good chance to have much data in
the page cache already, and it only cleans up folders that are changed
at the time they are. Exim already does parallel deliveries, making good
use of RAIDs, and things happen in time without disturbing anything else.

Some things only look easy until you try them.

Michael