8
###########################
# 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 Answers 2

16

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 
1
  • Damn, this is not how I imagined it. I have dozens of drive partitions and wanted the .snapshots dir to reside on the same partition. A lot of redundant configuration. It's like httpd where you have to have an httpd.conf for every instance, unlike python's SimpleHTTPDServer Commented Aug 13, 2021 at 5:06
6

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.