Linux – passing additional parameters to rsync using rsnapshot

backuplinuxrsnapshotrsync

I have my backups being performed by rsnapshot, works well.

EXCEPT, on one of the jobs for the /home volume I'd like rsync to copy the sym-links as physical directory/files. I believe the parameter is –copy-links for rsync but can't seem to find a way to pass it to rsync from rsnapshot.

Preferably I'd like to do this on a job by job basis. While it makes since for my /home tree it doesn't for /etc and /var.

Best Answer

Create a separate config file for this host

cp /etc/rsnapshot.conf /etc/rsnapshot.link.conf

Only add the directories where you want the symlinks to be copies and remove all of the other backup definitions.

add:

rsync_long_args --copy-links

near the

cmd_rsync       /usr/bin/rsync

line. and invoke like:

rsnapshot -c /etc/rsnapshot.link.conf daily

in cron.

Result:

[root@xxxxxxxxxxx /]# rsnapshot -c /etc/rsnapshot.link.conf daily
/bin/cp -al /.backups/links/daily.0 /.backups/links/daily.1
/usr/bin/rsync -a --copy-links --rsh=/usr/bin/ssh \
root@xxxxxxx:/home/ /.backups/links/daily.0/xxxxxx/
Related Topic