A simple question about rsnapshot.
In order to perform daily backups I'm going to add lines to cron in my Ubuntu.
Then, why do I have also these lines in the rsnapshot.conf ?
#########################################
# BACKUP INTERVALS #
# Must be unique and in ascending order #
# i.e. hourly, daily, weekly, etc. #
#########################################
interval hourly 6
interval daily 7
interval weekly 4
#interval monthly 3
If I use cron, should I disable them ? thanks
ps. I've just realized that in the crontab I still have "hourly" and "daily". Should I then uncomment only the one I use in the crontab ? And what's the point to specify hourly if it is already specified in cron ? I'm a bit confused.
# crontab -e
0 */4 * * * /usr/local/bin/rsnapshot hourly
30 23 * * * /usr/local/bin/rsnapshot daily
Your crontab job will call the relevant type of rsnapshot job to run. If you run rsnapshot hourly you will create a directory in your output directory called "hourly.0". Run it again, it will create "hourly.1".
So for every item you enable in your crontab, there should be a corresponding interval line in your
/etc/rsnapshot
file. If you decide not to use the hourly interval for example, then just leave the interval line in your configuration, but don't run an cron job that specifies "hourly".The confusion only arises because the default names are "hourly" "daily" and so on. These are simply labels that can be changed to suit your needs.
For my rsnapshot, I use "daysago", "weeksago" and "monthsago" :
No, you shouldn't disable them.
The interval config tells rsnapshot
The interval labels like "daily" and "weekly" don't mean anything (you could call them "x" and "y" if you wanted), but they must match the argument you pass in to rsnapshot when you call it.
In short, you need both - the interval config to tell rsnapshot how the different intervals relate, and the cron to execute it.
This isn't quite right, at least not with the current version of rsnapshot.
The first "retain" line in rsnapshot.conf (e.g. 'hourly') tells which name to copy the current backup to. The rest rotate. From the man page:
So, if you're not going to ever call
rsnapshot hourly
, your rsnapshot.conf shouldn't have aretain hourly
line.The "interval" directive actually replaces the "retain" in the previous versions. Yes, confusing, I know, but j-g-faustus explains it very clearly.