[lug] Mail archiving solutions

Peter Hutnick peter-lists at hutnick.com
Tue Jun 10 21:02:00 MDT 2003

Joseph Crotty said:

> All of my email is carbon copied to a master archive mbox file by
> procmail.  I would like to be able to run a cron job that calls a
> script, say weekly, that churns over the master archive file and sorts
> the mail into monthly files  (e.g. 0603.mail).

> http://www.cs.duke.edu/~des/scripts/sortmail_article.html
> However, this solution seems to beckon the dark ages (circa 1998).

This is known as "stable" in some circles ;-)

> Anyone have any better and/or more recent ideas?

The obvious solution in my mind is a cron job that run a script that
creates "next months" archive at about midnight on the last day of each
month, then links the "master archive file" to that months archive file.

Or, if you really want /two/ copies of every message that is over a month
old, have procmail deliver to the "master" and to "this_month" which,
again, would be a link to the actual [date].mail file.  (procmail will
happily deliver a message to two places.)

Maybe that is too simple, or not "cool" enough?


PS: Making cron run on the last day of every month is left to you as an

More information about the LUG mailing list