Dagurasu
2012-03-12
The feature requests don't look like they are read, so I'll submit this here for discussion:
No need to rotate. Give every backup directory a meaningful name like hourly/backup-date-time/.
After creating the latest backup symlink it to a directory named backup-latest
Use backup.latest as the link-dest (or cp -al source) for the next backup, then update the sym-link again.
As for crons, it's a mess for users to setup and doesn't work well on laptops without more mess (anacron).
Use one cron level, the fastest. EVERY time the cron job is called the script works through each level starting with yearly (slowest):
in each level do, (example starting with yearly here)
parse most recent yearly backup age;
if ( most recent yearly backup is older than threshold) {
move last montly backup to yearly folder
}
if ( number of yearly backups is greater than retain value ) {
remove oldest yearly backup
}
repeat for montly backups…
repeat for weekly
repeat for daily
rsync -dest-link backup.latest <source> hourly/backup-<today>-<now>
ln -s hourly/backup-<today>-<now> backup.latest
alternatively obviously you could skip the dest-link and do
cp -al backup.latest hourly/backup-<today>-<now>
before rsyncing.
working from outside in so that we have moved backups out of a level before asking if backups should be deleted from it.
Put together this does several good things:
1) anacron is not needed because you always just check for an age threshold and you do it every hour so if the computer is off during a montly backup time, it will still get backed up. This is a big deal I think
2) There is no rotation which is good just for simplicity if nothing else.
3) At realistic worst case an aborted operation leaves the symlink for dest-link (or cp) pointing to an older backup, which will still works fine.
4) Backup names are meaningful
5)users only need one cron job and don't need to worry about crazy cron timings and levels. You could just install a cron job for them in cron.hourly and save them the effort entirely (although I'd like see ability to do more than hourly retained).
6)It should work fine with the present configuration files
7)Only one command is needed: sync-first becomes pointless and rsnapshot hourly becomes unnecessary.
Dagurasu
2012-03-12
P.S. when I say rsnapshot hourly becomes unnecessary, I just mean the syntax. Obviously you still need to run rsnapshot in some short interval. I'd actually say every 10 minutes would be nice even if for most people it usually just checks to see that there is nothing to do 5 times out of 6. Sure 10 minutes is a little nuts but in this model it should be the fastest anyone might ever want to use it.
Dagurasu
2012-05-03
I bit the bullet and programmed it myslef… I attached a working code on the feature request page.. better to discuss it there:
https://sourceforge.net/tracker/index.php?func=detail&aid=3502264&group_id=88546&atid=587079
Olivier Briat
2012-05-25
Hi,
I've just test rsnapshot and I totally agree with dagurasuforge, a minimal structure : just dir names base on sortable date format yyyy-mm-dd-hh-mm-interval-name.
One cron job, default is 30mn, for a custom minimal interval, one could change the cron and uncomment the setting variable (cron_interval MM)
Beside these I got a couple of suggestions :
* Allow multiple target snapshot, with custom settings for each one, so one server could backup several folder or machine, each snapshot on different dir. (maybe with sub files like apache 2)
* get rid of the tab in the conf file : it's counter-intuitive and a real pain to edit with VI (which is the default editor of many sysadmin)