Rsnapshot, Multiple Backup Destinations
###########################
# 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 be assigned to a .snapshots
dir under my root directory, preserving the hierarchy.
So, I will have:
/.snapshots/localhost/home/username/some_dir/to_backup
Is it possible to somehow have 2nd dir to backup
something else like my /home/username/backup-scripts
?
source to share
copy an existing .conf with a different name sudo cp /etc/rsnapshot.conf /etc/rsnapshot-2ndname.conf
And make some changes specific to that directory using
sudo nano /etc/rsnapshot-2ndname.conf
save and run the second .conf file with the command sudo rsnapshot -c /etc/rsnapshot-2ndname.conf configtest
, if u get the syntax ok then dry run with sudo rsnapshot -c /etc/rsnapshot-2ndname.conf -t hourly
and then set up cronjobs for the 2nd directory with sudo nano /etc/cron.d/rsnapshot
, you can just add a bunch of lines below the already existing lines 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
source to share