Cron: Can't get my backup schedule to work with rsnapshot

you have to understand how rsnapshot generates the backups.

First of all: Only the first interval you are defining takes the snapshot all other intervals just move old snapshots.

In your example:

interval halfhourly 4

first moves the old snapshots from halfhourly.n to halfhourly.n+1. Then it takes a new snapshot in halfhourly.0.

When you run the other jobs (hourly, twohourly, daily, weekly) they just take the last snapshot of the former job. So: hourly.4 is moved to twohourly.0 twohourly.24 is moved to daily.0 daily.7 is moved to weekly.0

This explains why the timestamp of the snapshot is always .32. Because it is actually a "halfhourly" snapshot that was moved to "hourly".

Hope that helps, Alex


I'm not well versed in rsnapshot. But I've got a couple questions. First off, check /var/log/rsnapshot.run.log, and make sure the info there matches the directory names you were checking in /var/backup. And error message It's possible that might help shed a light on things.

Check the log and see what time things are running. If needbe, separate the logs into separate files, by making the log: /var/log/rsnapshot.run.$$.log. This plunks the PID in there, and should make them unique.

Secondly, could you provide the backup sections of your script? I'm curious to see where the backup files are supposed to go. A typo here could leave backup files strewn elsewhere on the system.

It's somewhat confusing looking at just the directory timestamps. It's possible your half-hourly script is modifying something that makes all the other directories timestamps get changed too. AFAIK, rsnapshot uses hard links of the previous backups. So modifications could percolate to other job directories. In this case, hourly would copy from half-hourly, which would explain what you're seeing.

Secondly, it would appear your version of cron doesn't support the */2 syntax. Hence why your hourly script only ran once, at 2:00 am. It might not handle MON either. So make a test job for each of those, and make sure it's actually running as expected.


--Christopher Karel