View previous topic :: View next topic |
Author |
Message |
Vermyndax Apprentice
Joined: 13 Dec 2003 Posts: 208
|
Posted: Wed Apr 14, 2004 3:26 pm Post subject: Archiving .maildir folders |
|
|
I have Gentoo running .maildirs for my users with courier-imap3d and courier-pop3d.
For those users who use IMAP, is there any decent method/cron job/idea for archiving messages and gzipping them or do I have to rely on the users to do that? |
|
Back to top |
|
|
davidblewett Apprentice
Joined: 15 Feb 2004 Posts: 274 Location: Indiana
|
Posted: Wed Apr 14, 2004 4:35 pm Post subject: |
|
|
Since .maildir is basically a simple file per message structure, you could use traditial backup methods to accomplish this. I like rdiff-backup. It uses the rsync protocol, and is able to backup to a local drive or across SSH to a network location. It also provides differential backups, so that you can get a backup from a certain point in time. Highly useful, especially for e-mail I would think. Since it's basically a mirror of the .maildir, all you have to do to restore is either use rdiff-backup's --restore-as-of feature or simply copy the file back from the backup location.
If you want it compressed, you would have to do that yourself, as this program doesn't do that. I'd be careful with compressing everything together, as this can complicate restores. _________________ No guilt in life, no fear in death
this is the power of Christ in me
From lifes first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album" |
|
Back to top |
|
|
Vermyndax Apprentice
Joined: 13 Dec 2003 Posts: 208
|
Posted: Wed Apr 14, 2004 6:24 pm Post subject: backing up |
|
|
Well, I have partimage and have used it every now and then to run backups, but I was mainly interested in this because of users who love to "save and never delete." I would like to be able to take a certain set of messages after a time period, gzip them up and place them somewhere as a cron job.
I guess I could milk the program you mentioned to accomplish something like that... kinda like the autoarchive function of Outlook... |
|
Back to top |
|
|
davidblewett Apprentice
Joined: 15 Feb 2004 Posts: 274 Location: Indiana
|
Posted: Wed Apr 14, 2004 7:11 pm Post subject: |
|
|
If this is a production environment, wouldn't you want the archive to be as seamless as possible? If you gzip things, it will require some kludges to get it to be invisible to the user. With rdiff-backup, I think it would be much easier to write scripts to retrieve a specific message from the backup. Here is the homepage: http://rdiff-backup.stanford.edu _________________ No guilt in life, no fear in death
this is the power of Christ in me
From lifes first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album" |
|
Back to top |
|
|
shadowlost n00b
Joined: 05 Apr 2004 Posts: 7 Location: Seattle, WA
|
Posted: Wed Apr 14, 2004 10:51 pm Post subject: ...if you happen to use xfs |
|
|
then you can try this. Or a variant.
/var/spool/mail is a set of RAID-1 9-gig drives, xfs.
maildirs are used throughout and symlinked to ~/Maildir (Damn you djb)
Courier/exim, yadda yadda
Code: |
#!/bin/sh -x
# $Header$
#vim: ts=3
BACKUP_LOCATION="/backup"
NOW=`date +%Y%m%d`
SESSION_LABEL="$2 - $NOW"
if [ $1 == "" ]; then
echo Usage:
echo $0 [dump_level] [backup_partition] [backup_name] \<xfsdump opts\>
fi
/bin/xfs_freeze -f $2
/sbin/xfsdump $4 $5 $6 -M "" -L "${SESSION_LABEL}" -l $1 -f $BACKUP_LOCATION/${NOW}-${3}-level${1}.xfsdump -p 300 $2
/bin/xfs_freeze -u $2
|
It leaves its files in $BACKUP_LOCATION, you call it like so:
Code: | ./xfsdump 0 /var/spool/mail mail |
It creates a file with everything on the filesystem (level0)
/backup/20040414-mail-level0.xfsdump
Code: | ./xfsdump 5 /var/spool/mail mail |
creates a file with everything that's changed since level0
/backup/20040414-mail-level5.xfsdump
Code: | ./xfsdump 9 /var/spool/mail mail |
creates a file with everything that's changed since level5, etc.
I do a few other things to keep the mail system from totally blocking, as xfs_freeze will allow reads, but block any write. (ever had 21000 exim delivery processes blocked in the morning?)
Implement this in cron or however your site deals with backups. Usually want to call it with an incrementing first parameter, 0 for your baseline, 1 annually, 2 monthly, 3 weekly, 4-9 daily... or at least that's how we do it. ;-) |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|