If you only want to backup the mails (the other data like contacts, users, and so on should not been backupped hope this is only a test enviroment ) you can do this with simple bash scripts and hunderds other good solutions.
You should always shutdown cyrus while backupping with simple scripts - if you do not your backup is perhaps inconsistent.
Nice trick:
First do a backup while cyrus is running, then shut down cyrus and backup the files that have changed during the first run. --> Very short downtime + consistent backup
Short example:
Code:
#!/bin/sh #simple semi-hotcopy cyrus backup in a folder #Author Daniel Halbe #Use on own risk and only after testing with testdata! echo "cyrus backup starts" echo "go for coffee" echo " create some directories" rm -rf /home/backup/cyrus rm -rf /home/backup/sieve mkdir -p /home/backup/cyrus/lib mkdir -p /home/backup/cyrus/spool mkdir -p /home/backup/sieve/spool echo " first rsync run" rsync -r /var/lib/cyrus /home/backup/cyrus/lib rsync -r /var/spool/ /home/backup/cyrus/spool rsync -r /var/spool/sieve /home/backup/sieve/spool echo "plug out phone" echo " halting cyrus" /etc/init.d/cyrus stop echo " second rsync run" rsync -r /var/lib/cyrus /var/backup.d/preliminary/cyrus/lib rsync -r /var/spool/cyrus /var/backup.d/preliminary/cyrus/spool rsync -r /var/spool/sieve /var/backup.d/preliminary/sieve/spool echo " start cyrus" /etc/init.d/cyrus start
One other thing I want to point out because I see it often:
Never ever use tar for making backups of important data!!! If tar archives get corrupt they cannot be opened in a simple way... Buy storage and backup 1:1 or use other archivers...
Daniel
Leave a comment: