On 10/02/19 4:50 PM, Robert Moskowitz via dovecot wrote:
I have been thinking, and reading, on how to back up my mailserver. I have not found any approach that seems ready to use.
I have run years without any backup, but would really like to have something in place. I figure I can attach a USB drive and backup to that, then from there rsync to something elsewhere. Further if that USB drive is a full mailserver image, I actually have a 'hot backup' where I only have to put the backup drive into a system and boot up at the last backup.
But this means properly copying all of /home/vmail and probably /home/sieve plus the /var/lib/mysql
Are there good tools that nicely does this? Or do I choose a time late at night (only I am sometimes in non-US timezones) to shut down all services and just use rsync?
And stopping services itself is thought provoking. What if Dovecot, amavis, mysql, or whatelse is in the middle of writing out a mail file what happens to that file and restart.
I use dirvish, which is based on rsync, and which only syncs changed files but uses hardlinks to keep storage and bandwidth down - it leaves me with a full copy of the tree for each date, with links between. I run it on a machine at home.
I don't ususally worry about stopping services; maildir should be all right. For databases, I use the backup tools provided to back up the running database, then use dirvish on the backups (and skip the database files themselves).
I do do it at night, to save load on the server (it's an LXC container on a VPS).
I believe rdiffbackup does something similar to dirvish.
Richard