SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
failing to understand rsnapshot backup rotation.
Author Message
Post failing to understand rsnapshot backup rotation. 
Even after playing with a test config for a bit and manually running test backups of a directory with junk files, I somehow  cannot grasp some of the behavior.

I install rsnapshot on a blank ubuntu setup.


I then mkdir /media/{initial,backup}


touch /media/initial/{file1,file2,file3,file4,file5}


Set snapshot_root to /media/backup


Leave the ubuntu defaults of retain hourly 6, daily 7, weekly 4.


Set verbose to 3, just for fun.


I then run rsnapshot hourly six times, manually. It creates hourly.0-5 as you would expect.


I then run rsnapshot daily, and it creates daily.0 as you would expect.


But if I try to run rsnapshot daily again, without running an hourly first, it says:


root < at > testbot:/media/backup# rsnapshot daily
echo 2486 > /var/run/rsnapshot.pid
mv /media/backup/daily.0/ /media/backup/daily.1/
/media/backup/hourly.5 not present (yet), nothing to copy
rm -f /var/run/rsnapshot.pid



Upon further investigation, I can see that the rsnapshot daily did a mv hourly.5 daily.0.


But why behave that way? The whole point is to have snapshots taken at certain times, even if nothing has changed. Since we are using hardlinks, there is no drawback to merely duplicating hourly.5 into daily.0, rather than renaming (mv-ing) the hourly.5 into daily.0. But now, since rsnapshot renames hourly.5 into daily.0, the next time rsnapshot tries to run daily, if the hourlies have failed for some reason daily will fail as well.


Maybe there is some benefit to this behavior that I'm missing.


Thanks in advance for your help, and sorry for the very long winded question, which I'm sure is probably a silly one.

Post failing to understand rsnapshot backup rotation. 
On 2012-06-06, Zachary Stern <zs < at > enternewmedia.com> wrote:

But if I try to run rsnapshot daily again, without running an hourly first,
it says:

root < at > testbot:/media/backup# rsnapshot daily
echo 2486 > /var/run/rsnapshot.pid
mv /media/backup/daily.0/ /media/backup/daily.1/
/media/backup/hourly.5 not present (yet), nothing to copy
rm -f /var/run/rsnapshot.pid

Upon further investigation, I can see that the rsnapshot daily did a mv
hourly.5 daily.0.

But why behave that way? The whole point is to have snapshots taken at
certain times, even if nothing has changed. Since we are using hardlinks,
there is no drawback to merely duplicating hourly.5 into daily.0, rather
than renaming (mv-ing) the hourly.5 into daily.0. But now, since rsnapshot
renames hourly.5 into daily.0, the next time rsnapshot tries to run daily,
if the hourlies have failed for some reason daily will fail as well.

Maybe there is some benefit to this behavior that I'm missing.

I think it makes sense to fail, in that you are hoping the first-
level backup (hourly) to run at least N more times before doing
the next second-level backup (daily). If there's a failure in the first
level backups, I'd want to know before running the second level backup.
(In practice the first level needs to run only once more before the
second will proceed normally.)

At least one benefit is that doing a rename is much faster than making
a copy, especially if your snapshot is large. There are probably other
advantages as well.

--keith

--
kkeller < at > wombat.san-francisco.ca.us



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Post failing to understand rsnapshot backup rotation. 
On Tue, Jun 5, 2012 at 6:20 PM, Zachary Stern <zs < at > enternewmedia.com> wrote:
But if I try to run rsnapshot daily again, without running an hourly first,
it says:
<snip>
But why behave that way? The whole point is to have snapshots taken at
certain times, even if nothing has changed. Since we are using hardlinks,
there is no drawback to merely duplicating hourly.5 into daily.0, rather
than renaming (mv-ing) the hourly.5 into daily.0. But now, since rsnapshot
renames hourly.5 into daily.0, the next time rsnapshot tries to run daily,
if the hourlies have failed for some reason daily will fail as well.

Maybe there is some benefit to this behavior that I'm missing.

You're thinking of it as "What if I wanted a backup system, with no
restrictions on implementation, how might it work?" Instead,
rsnapshot answers the question "What is the minimal amount of work
necessary to create a decent backup system?" Aka the lazy Unix
response.

ONLY the first interval receives the full copy-and-rsync treatment.
All of the other intervals steal the oldest slot from the earlier
interval. So my rsnapshot root looks like:

ls -lt /.snapshots/
total 244
drwxr-xr-x 6 root root 4096 2012-06-05 18:29 hourly.0
drwxr-xr-x 6 root root 4096 2012-06-05 12:33 hourly.1
drwxr-xr-x 6 root root 4096 2012-06-05 06:23 hourly.2
drwxr-xr-x 6 root root 4096 2012-06-05 00:29 hourly.3
drwxr-xr-x 6 root root 4096 2012-06-04 06:23 daily.0
drwxr-xr-x 6 root root 4096 2012-06-03 06:26 daily.1
drwxr-xr-x 6 root root 4096 2012-06-02 06:24 daily.2
drwxr-xr-x 6 root root 4096 2012-06-01 06:23 daily.3
drwxr-xr-x 6 root root 4096 2012-05-31 06:24 daily.4
drwxr-xr-x 6 root root 4096 2012-05-30 06:24 daily.5
drwxr-xr-x 6 root root 4096 2012-05-29 06:25 daily.6
drwxr-xr-x 6 root root 4096 2012-05-26 06:23 weekly.0
drwxr-xr-x 6 root root 4096 2012-05-19 06:24 weekly.1
drwxr-xr-x 6 root root 4096 2012-05-12 06:23 weekly.2
drwxr-xr-x 6 root root 4096 2012-05-05 06:22 weekly.3
drwxr-xr-x 6 root root 4096 2012-04-28 06:21 weekly.4
drwxr-xr-x 6 root root 4096 2012-04-21 06:23 monthly.0
drwxr-xr-x 6 root root 4096 2012-03-24 06:20 monthly.1
drwxr-xr-x 6 root root 4096 2012-02-18 06:21 monthly.2
drwxr-xr-x 6 root root 4096 2011-11-19 06:26 quarterly.0
...

I keep 500 quarterlies (ie, forever).

Note that since weeks don't evenly divide months, this means that the
monthly and higher intervals have an odd period. Once upon a time I
considered switching to keeping open-ended weekly snapshots, or 31
daily then going to open-ended montly, but I couldn't think of a good
justification for why that would really matter. If you need backups
on a specific day of the month, then you should specifically arrange
for that. In the short term, I just want backups for recovery. In
the long term, I might want to be able to find that thing I changed
"last fall".

-scott

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Post failing to understand rsnapshot backup rotation. 
Hallo, Zachary,

Du meintest am 05.06.12:

I then run rsnapshot daily, and it creates daily.0 as you would
expect.

But if I try to run rsnapshot daily again, without running an hourly
first, it says:

root < at > testbot:/media/backup# rsnapshot daily
echo 2486 > /var/run/rsnapshot.pid
mv /media/backup/daily.0/ /media/backup/daily.1/
/media/backup/hourly.5 not present (yet), nothing to copy
rm -f /var/run/rsnapshot.pid

Upon further investigation, I can see that the rsnapshot daily did a
mv hourly.5 daily.0.

Yes - that's right. And that's the well known way making backups with a
set of (p.e.) tapes. They are only renumbered/renamed.

Only the first backup (on your machine: "hourly.0") is a new backup.

Take a look at the timestamps of the backups - then the "rsnapshot"
scheme is (together with the messages in "rsnapshot.log" nearly self
explaining.

Viele Gruesse!
Helmut

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB