2

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.

Wranorn
  • 195
  • 1
  • 1
  • 9

1 Answers1

2

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/
Daniel Widrick
  • 3,488
  • 2
  • 13
  • 27
  • Thank you! I live give this a shot this evening and mark it if it works. – Wranorn Aug 08 '15 at 02:42
  • 1
    Worked! Thank You! Only thing to note is the spacing "rsync_long_args" and "--copy-links" MUST be a space or rsnapshot will complain about it. – Wranorn Aug 08 '15 at 11:00
  • 1
    One other thing snapshot_root needs to be pointing to another destination or it will rotate the backups. – Wranorn Aug 08 '15 at 11:12