###########################
# SNAPSHOT ROOT DIRECTORY #
###########################
# All snapshots will be stored under this root directory.
#
snapshot_root /.snapshots/
###############################
### BACKUP POINTS / SCRIPTS ###
###############################
# LOCALHOST
# 1st dir to backup
backup /home/username/some_dir/to_backup/ localhost/
# 2nd dir to backup
backup /home/username/another_dir/to_backup/ localhost/
#backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog
#backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/
现在有了这些设置,所有备份的目的地都将在
.snapshots
dir中在我的根目录下,保持层次结构。
因此,我将拥有:
/.snapshots/localhost/home/username/some_dir/to_backup
是否有可能以某种方式让
2nd dir to backup
具有另一个目的地,例如我的
/home/username/backup-scripts
? 最佳答案
使用另一个名称sudo cp /etc/rsnapshot.conf /etc/rsnapshot-2ndname.conf
复制现有的.conf
并使用此目录进行一些特定于此的更改
sudo nano /etc/rsnapshot-2ndname.conf
如果语法正确,使用
sudo rsnapshot -c /etc/rsnapshot-2ndname.conf configtest
命令保存并运行第二个.conf文件,然后使用sudo rsnapshot -c /etc/rsnapshot-2ndname.conf -t hourly
进行空运行,然后使用sudo nano /etc/cron.d/rsnapshot
为第二个目录配置cronjobs,您只需在其中已经存在的行下面添加行集,30 */4 * * * root /usr/bin/rsnapshot -c /etc/rsnapshot-2ndname.conf hourly
01 1 * * * root /usr/bin/rsnapshot -c /etc/rsnapshot-2ndname.conf daily
01 2 * * 0 root /usr/bin/rsnapshot -c /etc/rsnapshot-2ndname.conf weekly
01 5 1 * * root /usr/bin/rsnapshot -c /etc/rsnapshot-2ndname.conf monthly
01 8 1 1 * root /usr/bin/rsnapshot -c /etc/rsnapshot-2ndname.conf yearly
关于rsync - rsnapshot,多个备份目标,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25672334/