amanda
, bacula
, BackupPC
. Those are client/server system featuring many options, whose configuration is rather difficult. Some of them provide user-friendly web interfaces to mitigate this. But Debian contains dozens of other backup software covering all possible use cases, as you can easily confirm with apt-cache search backup
.
rsync
command (from the package of the same name) is used daily to back up these different servers.
rsync
command is preceded by a duplication of the content of the previous backup with hard links, which prevents usage of too much hard drive space. The rsync
process then only replaces files that have been modified since the last backup. With this mechanism a great number of backups can be kept in a small amount of space. Since all backups are immediately available and accessible (for example, in different directories of a given share on the network), you can quickly make comparisons between two given dates.
dirvish
program. It uses a backup storage space (“bank” in its vocabulary) in which it places timestamped copies of sets of backup files (these sets are called “vaults” in the dirvish documentation).
/etc/dirvish/master.conf
file. It defines the location of the backup storage space, the list of “vaults” to manage, and default values for expiration of the backups. The rest of the configuration is located in the bank/vault/dirvish/default.conf
files and contains the specific configuration for the corresponding set of files.
Contoh 9.3. Berkas /etc/dirvish/master.conf
bank: /backup exclude: lost+found/ core *~ Runall: root 22:00 expire-default: +15 days expire-rule: # MIN HR DOM MON DOW STRFTIME_FMT * * * * 1 +3 months * * 1-7 * 1 +1 year * * 1-7 1,4,7,10 1
bank
setting indicates the directory in which the backups are stored. The exclude
setting allows you to indicate files (or file types) to exclude from the backup. The Runall
is a list of file sets to backup with a time-stamp for each set, which allows you to assign the correct date to the copy, in case the backup is not triggered at precisely the assigned time. You have to indicate a time just before the actual execution time (which is, by default, 10:04 pm in Debian, according to /etc/cron.d/dirvish
). Finally, the expire-default
and expire-rule
settings define the expiration policy for backups. The above example keeps forever backups that are generated on the first Sunday of each quarter, deletes after one year those from the first Sunday of each month, and after 3 months those from other Sundays. Other daily backups are kept for 15 days. The order of the rules does matter, Dirvish uses the last matching rule, or the expire-default
one if no other expire-rule
matches.
Contoh 9.4. Berkas /backup/root/dirvish/default.conf
client: rivendell.falcot.com tree: / xdev: 1 index: gzip image-default: %Y%m%d exclude: /var/cache/apt/archives/*.deb /var/cache/man/** /tmp/** /var/tmp/** *.bak
hostname
), especially those in the root tree (tree: /
), except those listed in exclude
. The backup will be limited to the contents of one filesystem (xdev: 1
). It will not include files from other mount points. An index of saved files will be generated (index: gzip
), and the image will be named according to the current date (image-default: %Y%m%d
).
dirvish --vault vault --init
command. From there on the daily invocation of dirvish-runall
will automatically create a new backup copy just after having deleted those that expired.