[KLUG Members] cyrus imap backup

Adam Tauno Williams members@kalamazoolinux.org
Mon, 10 Nov 2003 06:23:54 -0500


> > Does anyone out there using cyrus imap have a preferred procedure
> I use PAM to disable IMAP access from 1:00am - 3:00am,  and schedule cron to
> spool the requisite files onto a tape.
> > doing a backup of data.  ie what directories,
> /var/spool/imap, /var/lib/imap, /etc/imapd.conf, /etc/cyrus.conf
> > should the service be turned off.  
>No, then you won't be able to deliver messages into the store.

After you do a restore, you do a batchreconstruct, before you start the service.
 This verifies that the indexes are valid, deleted messages are actually deleted
- more or less what the checkpoint would do, just manually.  If you restore only
a certain mailbox you only need to run the batchreconstruct utility on that mailbox.

If the mailbox /var/spool/imap/a/user/adam gets backed up, and then a message
gets delivered, that message won't be in the backup - but everything will still
be valid.  The only inconsistency that can occur is a message added to or
deleted from a mailbox while backing up that mailbox (pretty unlikely unless
your really busy) but batchreconstruct will fix that.  It will either remove the
message from the indexes if the message file is not on the tape, or if the
message file is restored but not in the index (index got written to tape prior
to messages) it will scan the message headers and add it to the index.

The only really strange thing is if someone deletes a tree of mail folders
during the backup, so I just disable IMAP access during the backup.