|
This handler slowly creates a backup of each user's maildir
to a remote server. It is designed to be run with low overhead
in terms of cpu and bandwidth so it runs pretty slow. It is designed to scale well: it has been run with over ten thousand users and 60 gigs of storage.
if destdir is /backup/maildir/, then it will contain the files
daily.1
daily.2
daily.3
weekly.1
weekly.2
monthly.1
if keepdaily is 3, keepweekly is 2, and keepmonthly is 1.
The basic algorithm is to rsync each maildir individually,
and to use hard links for retaining historical data.
We rsync each maildir individually because it becomes very
unweldy to start a single rsync of many hundreds of thousands
of files.
For the backup rotation to work, destuser must be able to run
arbitrary bash commands on the desthost.
This script assumes that the source directory contains the directories 'a' through 'z', and that the actual maildirs are stored in these letter directories.
Here is an example configuration, /etc/backup.d/example.maildir:
when = everyday at 18:00
|
