amanda
, bacula
, or BackupPC
. Those are client/server systems featuring many options, whose configuration is rather difficult. Some of them provide user-friendly web interfaces to mitigate this. For non-enterprise systems, administrators might want to check out rsnapshot
or rdiff-backup
. Users can easily create backups of their filesystems with timeshift
, fsarchiver
, duplicity
, or even dd
.
apt-cache search backup
.
rsync
命令 (取自同名的软件包) 用于日常备份这些服务器。
rsync
命令对之前备份的内容使用硬链接,这样可以避免使用过多的硬盘空间。 然后rsync
进程只覆盖上次备份后修改过的文件。通过这种机制,大量的备份只占用小的磁盘空间。所有的备份会立即生效并且可以读写(例如,在共享网络上的不同目录),可以迅速比较两个不同日期的文件。
dirvish
程序执行。使用备份存储空间(“空”的),放置有时间戳的备份文件集(这些文件集在dirvish 文档中称为“vaults”)。
/etc/dirvish/master.conf
文件中。它定义了备份存储空间的位置,要管理的“vaults”,和备份超期的默认值。配置的其他部分在 bank/vault/dirvish/default.conf
文件中,包含对应文件集的特殊配置。
例 9.3. /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 (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.
例 9.4. /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
),主要是在根目录下(tree: /
),除了在 exclude
中列出的文件。备份仅限于一个文件系统中的内容(xdev: 1
)。不包含其他挂载点的文件。产生保存文件的索引(index: gzip
),镜像文件根据当前日期进行命名(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.
dconf
(see 第 13.3.1 节 “GNOME” for more information about this).