[Mailman-Users] archive rotation

Jon Carnes jonc at nc.rr.com
Wed Mar 10 17:59:10 CET 2004


On Wed, 2004-03-10 at 10:47, Al Black wrote:
> Hi Jon, all.
> 
>  > >I'm wondering if anyone has a script that manages archive rotation.  I'm
>  > >thinking of something that can run from cron and keeps messages that have
>  > > been around less than an month (30 days, etc), and discarding the rest.
> 
> >I use logrotate at my sites to rotate my logs monthly. It's simple to
> >setup and it's already running on most systems. I generally keep 4
> >months worth of back logs.
> 
> Thanks.  I guess I should have been more clear.
> 
> What I'm wondering about is the archived messages in 
> /usr/local/mailman/archives/private/* rather than the log files.  I have 
> the lists set up so that new archive volumes are set up on a monthly 
> basis.  So the directory for each list looks like:
> 
> 2003-December  (directory)
> 2003-December.txt
> 2003-December.txt.gz
> 2004-February (directory)
> 2004-February.txt
> 2004-February.txt.gz
> 2004-January (directory)
> 2004-January.txt
> 2004-January.txt.gz
> 2004-March (directory)
> 2004-March.txt
> 2004-March.txt.gz
> 
> And inside each of those directories are a whack of html files, pages, and 
> a symbolic link.
> 
> Ideally, I'd like to keep 30 days of messages, so that users who go on 
> vacation or set no mail for various reasons can go back and take a look at 
> what they missed.  Its different than the usual reasons for having an 
> archive, but it makes sense for social kinds of mailing lists.
> 
> Obviously, I'll have to do some configuration tweaks, switch to a yearly 
> archive, and parse from there.   But it wouldn't surprise me if someone had 
> done something like this before.
> 
> Thanks,
> al
> 
Doh! I really should drink my coffee before answering these.

I've written some stuff that does this for Pipermail. It's not as easy
as you think.  The hardest part is editing the mbox file that is used
for archive storing and for rebuilding the archives. You've got to pull
the old mail out of the mbox, while keeping the current mail.
If you can get that part done, then the rest follows nicely.

You can use a trigger email that is sent to the archives monthly (mine's
cleverly disguised as a monthly mailing list policy reminder). If you
use that as your anchor within the mbox file, then cutting the file is
fairly trivial.
 
Good Luck - Jon Carnes





More information about the Mailman-Users mailing list