I use a procmail rule for that:

:0 c :
$MAILDIR/Archive/`date +%Y-%m`

Which copies all incoming mail into a YYYY-DD mbox format mailbox, and
then lets the message continue through any other rules that I have. 

Works For Me (tm).

M

On Sat, Jul 14, 2001 at 08:34:26AM -0600, dan radom wrote:
> I've got several mbox format mailboxes I want to archive monthly.  I've come up with 
>the following shell script to run from cron, but I'm not sure there isn't a better 
>way to go about this.  Here's the script..
> 
>       #!/bin/sh
>       maildir=/home/graffix/mail
>       for x in $maildir/lug $maildir/support $maildir/mutt-users $maildir/procmail
>           do tar czfp $x-`date '+%m-%Y'`.tar.gz $x ; cp /dev/null $x
>       done
> 
> 
> My main concern is that mutt might be in the process of writing to a mbox when cron 
>fires off the script.  I'm guessing that could create some problems and possibly even 
>lost email.  Anyone have a better suggestion?
> 
> Dan

Reply via email to