rsnapshot, multiple backup destinations

6.1k Views Asked by At
###########################
# 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/

Now with these settings, all backups will have destination in .snapshots dir under my root directory, keeping hierarchy.

So I will have:

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

Is it possible somehow to have that 2nd dir to backup have another destination, like for example my /home/username/backup-scripts?

2

There are 2 best solutions below

0
On

Not without creating another config with a different snapshot_root then running it with rsnapshot -c new.conf

1
On

copy existing .conf with another name sudo cp /etc/rsnapshot.conf /etc/rsnapshot-2ndname.conf And make some changes specific for this directory using

sudo nano /etc/rsnapshot-2ndname.conf

save and run the second .conf file with command sudo rsnapshot -c /etc/rsnapshot-2ndname.conf configtest if u get syntax ok , then make a dry run with sudo rsnapshot -c /etc/rsnapshot-2ndname.conf -t hourly then configure cronjobs for 2nd directory by using sudo nano /etc/cron.d/rsnapshot u can just add set of lines below the already existing lines in there,

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