6

I'm trying to get rsnapshot working for remote backups (via ssh). I have a working configuration and I can perform all my backups.

In my conf I have enabled sync_first=1. As I understand it, this means that I have to always first run the rsnapshot sync command to actually go and grab the backup files first, then run the rsnapshot hourly command to simply symlink and rotate the backups.

Now the problem. I'm not sure if this is by design, but I am noticing that every time I run rsnapshot sync, every file on my remote machine it being backed again regardless of whether it has changed since the last backup. This means the rsnapshot sync command takes > 1hr.

Is this the designed behaviour?

Should I be running sync every hour before running hourly/daily/weekly?

1 Answers1

2

Yes, you should be running sync first. sync synchronizes to the .sync directory. hourly then rotates away .sync to hourly.0. The nice thing is that you can run rsnapshot sync again, after an interrupted rsnapshot sync, and it will continue where it left off.

I have this in my crontab:

# make backups every 2 hours - and skip hourly backups at night
0 0,6,8,10,12,14,16,18,20,22 * * * /opt/bin/rsnapshot sync && /opt/bin/rsnapshot hourly

# rotate a daily every night at 5
0 5 * * * /opt/bin/rsnapshot daily

Do note that, in the above crontab, if rsnapshot sync produced warnings, but could still finish the backup, it will return with an error code of 2. That means that rsnapshot hourly will not run. If this happens every time, then you don't have any hourlies, nor dailies - just the .sync directory.

rubo77
  • 5,218