So I setup my new server so reevaluated my rsnapshot setup. I see now there is 3 new (well new to me at least) options to set.
link_dest 1
sync_first 1
use_lazy_deletes 1
Link Dest is just basically telling it to Rsnapshot use an Rsync feature that's better for sync with hard links.
Lazy Delete is just a nicer way of doing all the syncing and then deleting the old stuff.
Sync First is the one that seems newer to me. Basically you do rsnapshot sync to create a new backup to the .sync folder. Then calling any other rsnapshot <hourly | daily | weekly> just rotates (moves and deletes).
So I've read the big advantage is if the sync fails, then you don't wind up rotating in a bunch of bad backups into your mix, but what I tested today is you still lose your higher up backups. Meaning if you use Hourly as your lowest your daily, weekly, and monthly backups can rotate off the cliff if you continue to have undetected failed backups. This issue doesn't happen for the hourly in this case, because the hourly is called immediately after a sync completes successfully. So if the sync fails, the hourly doesn't rotate.
So I was just wondering if anyone had found a nice way to work around this.
Here's an example of what I mean. This is considering the sync is failing so the second hourly (2 of 2, hourly.1) doesn't exist because it's already been moved to daily.0 and a new hourly.1 isn't created because of the failed sync.
If daily continues to run, then eventually it will shift all the backups off the cliff and there will be no dailys left.
Thanks for any advice!
link_dest 1
sync_first 1
use_lazy_deletes 1
Link Dest is just basically telling it to Rsnapshot use an Rsync feature that's better for sync with hard links.
Lazy Delete is just a nicer way of doing all the syncing and then deleting the old stuff.
Sync First is the one that seems newer to me. Basically you do rsnapshot sync to create a new backup to the .sync folder. Then calling any other rsnapshot <hourly | daily | weekly> just rotates (moves and deletes).
So I've read the big advantage is if the sync fails, then you don't wind up rotating in a bunch of bad backups into your mix, but what I tested today is you still lose your higher up backups. Meaning if you use Hourly as your lowest your daily, weekly, and monthly backups can rotate off the cliff if you continue to have undetected failed backups. This issue doesn't happen for the hourly in this case, because the hourly is called immediately after a sync completes successfully. So if the sync fails, the hourly doesn't rotate.
So I was just wondering if anyone had found a nice way to work around this.
Here's an example of what I mean. This is considering the sync is failing so the second hourly (2 of 2, hourly.1) doesn't exist because it's already been moved to daily.0 and a new hourly.1 isn't created because of the failed sync.
Code:
[root@server1 snapshots]# rsnapshot daily
echo 17035 > /var/run/rsnapshot.pid
mv /backup/snapshots/daily.3/ /backup/snapshots/daily.4/
mv /backup/snapshots/daily.2/ /backup/snapshots/daily.3/
mv /backup/snapshots/daily.1/ /backup/snapshots/daily.2/
mv /backup/snapshots/daily.0/ /backup/snapshots/daily.1/
mv /backup/snapshots/hourly.1/ /backup/snapshots/daily.0/
rm -f /var/run/rsnapshot.pid
[root@server1 snapshots]# rsnapshot daily
echo 17209 > /var/run/rsnapshot.pid
mv /backup/snapshots/daily.4/ /backup/snapshots/daily.5/
mv /backup/snapshots/daily.3/ /backup/snapshots/daily.4/
mv /backup/snapshots/daily.2/ /backup/snapshots/daily.3/
mv /backup/snapshots/daily.1/ /backup/snapshots/daily.2/
mv /backup/snapshots/daily.0/ /backup/snapshots/daily.1/
/backup/snapshots/hourly.1 not present (yet), nothing to copy
rm -f /var/run/rsnapshot.pid
[root@server1 snapshots]# rsnapshot daily
echo 17701 > /var/run/rsnapshot.pid
mv /backup/snapshots/daily.5/ /backup/snapshots/daily.6/
mv /backup/snapshots/daily.4/ /backup/snapshots/daily.5/
mv /backup/snapshots/daily.3/ /backup/snapshots/daily.4/
mv /backup/snapshots/daily.2/ /backup/snapshots/daily.3/
mv /backup/snapshots/daily.1/ /backup/snapshots/daily.2/
/backup/snapshots/hourly.1 not present (yet), nothing to copy
rm -f /var/run/rsnapshot.pid
[root@server1 snapshots]# rsnapshot daily
echo 18490 > /var/run/rsnapshot.pid
mv /backup/snapshots/daily.6/ /backup/snapshots/_delete.18490/
mv /backup/snapshots/daily.5/ /backup/snapshots/daily.6/
mv /backup/snapshots/daily.4/ /backup/snapshots/daily.5/
mv /backup/snapshots/daily.3/ /backup/snapshots/daily.4/
mv /backup/snapshots/daily.2/ /backup/snapshots/daily.3/
/backup/snapshots/hourly.1 not present (yet), nothing to copy
rm -f /var/run/rsnapshot.pid
/bin/rm -rf /backup/snapshots/_delete.18490
If daily continues to run, then eventually it will shift all the backups off the cliff and there will be no dailys left.
Thanks for any advice!