1

I have to following configuration.

rsnapshot.conf

interval        halfhourly      4
interval        hourly  6
interval        twohourly       12
interval        daily   7
interval        weekly  4

crontab

0,30 * * * * /usr/bin/rsnapshot halfhourly >> /var/log/rsnapshot.halfhourly.log 2>&1
5 * * * * /usr/bin/rsnapshot hourly >> /var/log/rsnapshot.hourly.log 2>&1
10 */2 * * * /usr/bin/rsnapshot twohourly >> /var/log/rsnapshot.twohourly.log 2>&1
15 3 * * * /usr/bin/rsnapshot daily >> /var/log/rsnapshot.daily.log 2>&1
20 6 * * MON /usr/bin/rsnapshot weekly >> /var/log/rsnapshot.weekly.log 2>&1

Only halfhourly is running correctly now. hourly spits out this error:

rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot hourly
----------------------------------------------------------------------------
ERROR: Lockfile /var/run/rsnapshot.pid exists and so does its process, can not continue

To me it seems like my 5 min space between halfhourly and hourly is too small. Is this configuration crazy? I like having backups every thirty minutes, that will probably save my ass some day.

Please help me make a decent backup schedule, that doesn't clog up the system, but creates frequent enough backups.

Thank you.

Markus Hedlund
  • 1,127
  • 2
  • 19
  • 33
  • Heads up, googlers: this seems to be a follow-up to https://serverfault.com/questions/182809/cron-cant-get-my-backup-schedule-to-work-with-rsnapshot – ᴍᴇʜᴏᴠ Oct 29 '21 at 05:58

2 Answers2

1

rsnapshot/rsync can take a while just trying to figure out what files changed. So it's not really a good solution for really quick snapshots unless you're not dealing with many files.

You may want to look at options from this question. Although I'm not sure that question has a definitive solution for you.

For fast snapshots you'll need to move to a block level snapshot using btrfs or LVM. Neither of those solutions are ideal as btrfs is still experimental and LVM's snapshots aren't that robust and have issues of their own.

3dinfluence
  • 12,449
  • 2
  • 28
  • 41
0

One issue with using rsnapshot for snapshot backups is that it does take some time to copy and link changed files. That will limit the frequency of backups as you have seen.

If you really want to make frequent snapshot backups, you should look at doing it at a lower level. I suggest checking out the snapshot facility built in to LVM. You will need to recreate your filesystem on top of an LVM volume but that will give you a more powerful lower-level snapshot tool you can run more frequently.

Phil Hollenback
  • 14,947
  • 4
  • 35
  • 52