As always...you design your backup for your application.

Mail servers are particularly tricky, as the data the contain tends to change minute-by-minute, and they are prone to both hardware failure, administrator error AND user error. A user who nukes their mail store will want their data restored, but the other ten thousand users will NOT want their mail store rolled back 24 hours (or whatever your backup interval is). Dumps aren't so good at dealing with that.

For a POP mail server, daily backups of the mailstore are almost useless...you restore data that's already been retrieved, you don't restore data that wasn't retrieved.

For IMAP servers using a Maildir storage system, backup is relatively straight forward -- rsync does wonders. But, understand how your system works. Maildir is very slick for this -- generally, a file exists in a maildir, or it doesn't...once it exists, it generally isn't supposed to change (though it may be deleted). This is screaming "rsync!".

However, backing up an IMAP mail store daily leaves a lot to be desired. Most likely time for someone to accidentally delete the important mail they have been waiting for is probably not too long after it arrives. Depending (mostly) on the number of messages in your mail store, you may be able to run an rsync of the maildir hourly or maybe even every 15 minutes to another local hard disk. You could make that rsync cumulative -- no removing of deleted files, then daily rsync that backup off to another machine (using --link-dest option for a quick, rotated backup), and then doing an rsync WITH deletion to your local system, so your backup store doesn't grow without bound.

Note that with this strategy, you will end up restoring deleted e-mails and duplicating sorted e-mails. Imperfect, but overall, more annoying than harmful.

If your IMAP server keeps a local index, you will need to "fix" that after a restore. You may need to lay a beating on the local indexes of your IMAP clients, too. Again, you really have to understand your task here and the tools you are using. This isn't a "How To" kinda thing, this is an "Understand. Then do" thing. Having any form of backup without knowing how to USE it to deal with real-life disasters is useless. If your e-mail server has an SQL database associated with it, you will have to know how to manage that in conjunction with the IMAP files. This can get ugly fast.

Also....with e-mail, look at the legal issues of backups. You generally don't want years worth of backups in many countries, as they could be fodder for a lawyer's "discovery" expeditions. Whatever you do for backup should be clearly documented, i.e., "We backup one week's worth of data", and it should be documented BEFORE the lawyers come knocking. This is a good place for using a second computer as the backup device, so you always know where all your backups are...rather than tapes, where a five year old tape that fell behind a desk could come back to haunt you later.

And, it's all useless unless you know you can restore it, so practice... odds are, you will learn something.

Nick.



On 12/28/2011 01:06 AM, Wesley M. wrote:
Hi,
I want to backup our mailserver(4.7) in production.
I read :
http://www.openbsd.org/faq/faq10.html#DupFS

Can i do this wd1(my backup
disk) :

mount /dev/wd1a /mnt
dump -0auf /mnt/etc_backup /dev/wd0a
...
same
for wd0d and wd0e ... Or do i need absolutely to do it in Single User?

Or
perhaps, there's a better way to do it.

Thank you very much.

Wesley.

Reply via email to