Backing up mailboxes

Andrew Morgan morgan at orst.edu
Thu Jun 9 13:04:04 EDT 2011


On Thu, 9 Jun 2011, Diego Ventrice wrote:

> I'm planning a backup strategy for a new server that will handle
> Hundreds of mailboxes. Largest server for me to admin so far
>
> Would you share your experiences backing up cyrus mailboxes ?
> What tool/s do you use ? how many backups a day do you run ?

Enabling delayed delete and delayed expunge will help a lot:

delete_mode: delayed
expunge_mode: delayed

You'll also want to modify your expire line in cyrus.conf to something 
like this:

   delprune      cmd="/usr/local/cyrus/bin/cyr_expire -E 1 -X 7 -D 7" at=0100

-D and -X control how long deleted and expunged items remain on-disk:

    -D delete-days
           Remove previously deleted mailboxes older than delete-days (when
           using the "delayed" delete mode).

    -X expunge-days
           Expunge previously  deleted  messages  older  than  expunge-days
           (when using the "delayed" expunge mode).

In the example above, messages and mailboxes are deleted from disk after 7 
days.  This gives you a 7 day window to very easily restore deleted 
mailboxes and messages.  At our site, I hardly ever have to restore email 
from backups.

We use EMC Networker for backups here.  Some folks have systems setup to 
do snapshots of the filesystem before a backup, but we just backup the 
files like any other filesystem.  However, the mailboxes database is very 
important.  We dump it to a flat file every hour, like so:

DATE=`date +%Y%m%d-%H%M`

# Make a plaintext dump of the Cyrus mailboxes database
/usr/local/cyrus/bin/ctl_mboxlist -d > \
   /var/spool/cyrus/config/db-dumps/mailboxes.db.dump.${DATE}

# Keep 2 days of dumps
find /var/spool/cyrus/config/db-dumps/ -mtime +1 -exec rm {} \;


Let me know if you have any other questions.

 	Andy


More information about the Info-cyrus mailing list