rsnapshot,多个备份目标

时间:2014-09-04 18:12:01

标签: rsync rsnapshot

###########################
# 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目录中具有目标 在我的根目录下,保持层次结构。

所以我会:

/.snapshots/localhost/home/username/some_dir/to_backup

是否有可能让2nd dir to backup拥有另一个。{1}} 目的地,例如我的/home/username/backup-scripts

2 个答案:

答案 0 :(得分:7)

使用其他名称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 

答案 1 :(得分:2)

使用不同的snapshot_root创建另一个配置,然后使用rsnapshot -c new.conf

运行它