Discussion:
[rsnapshot-discuss] Promotion of lower intervals
Chris Miller
2015-06-24 14:27:21 UTC
Permalink
Hi Folks,

rsnapshot runs with an argument that tells it which interval to handle. The current interval, whichever interval it is, first sees a sequential promotion of all the generations, leaving an open slot at the lowest position. In the case of the lowest interval, t his lowest position is filled with a new backup. In the case of all other intervals, t his lowest position is filled with by promoting the OLDEST generation of the adjacent, lower interval.

I'd like to change this by promoting the NEWEST generation of the adjacent, lower interval. The biggest reason for this is that the promoted generation is not on the boundary of the new interval. Suppose I have the normal "day", "week", "month", "year" intervals, and suppose I have, say, 10 daily backups. When I promote one of them to "week" on Sunday, I will not be getting a Sunday backup, it will be a Wednesday backup. This is the same problem for "month" not being a first or last day of the month, but even worse because the existing "day" offset compounds. By the time I get to "year" I will be off by quite a bit.

I don't know perl well enough to read it very well, but this looks to be really good time to learn. Can somebody point me to the area in the code that handles this promotion? I can probably figure it out from there. This should become a configurable behavior.

Thanks for the help,

Chris.
Patrick O'Callaghan
2015-06-24 15:03:41 UTC
Permalink
I'd like to change this by promoting the *NEWEST* generation of the
adjacent, lower interval. The biggest reason for this is that the promoted
generation is not on the boundary of the new interval. Suppose I have the
normal "day", "week", "month", "year" intervals, and suppose I have, say,
10 daily backups. When I promote one of them to "week" on Sunday, I will
not be getting a Sunday backup, it will be a Wednesday backup. This is the
same problem for "month" not being a first or last day of the month, but
even worse because the existing "day" offset compounds. By the time I get
to "year" I will be off by quite a bit.
The new release of Rsnapshot will use alpha, beta and gamma rather than
day, week month, so some of the potential confusion is eliminated. That
said, I think many people would actually like to keep monthly and have it
mean monthly, and not just weekly*4, which as you say gets out of sync
really quickly.

poc
David Cantrell
2015-06-24 15:52:12 UTC
Permalink
Post by Patrick O'Callaghan
The new release of Rsnapshot will use alpha, beta and gamma rather than
day, week month, so some of the potential confusion is eliminated. That
said, I think many people would actually like to keep monthly and have it
mean monthly, and not just weekly*4, which as you say gets out of sync
really quickly.
You've always been able to call them whatever you like. The
documentation is changing to alpha/beta/gamma because we found that
having daily/weekly/monthly/etc in the doco confused people and made
them think that rsnapshot knew about those by default and would run in
the background taking backups periodically.
--
David Cantrell | Bourgeois reactionary pig

Suffer the little children to come unto me, as
their buying habits are most easily influenced.
-- Marketroid Jesus
Scott Hess
2015-06-24 16:13:11 UTC
Permalink
Post by David Cantrell
Post by Patrick O'Callaghan
The new release of Rsnapshot will use alpha, beta and gamma rather than
day, week month, so some of the potential confusion is eliminated. That
said, I think many people would actually like to keep monthly and have it
mean monthly, and not just weekly*4, which as you say gets out of sync
really quickly.
You've always been able to call them whatever you like. The
documentation is changing to alpha/beta/gamma because we found that
having daily/weekly/monthly/etc in the doco confused people and made
them think that rsnapshot knew about those by default and would run in
the background taking backups periodically.
It is certainly the case that before patching up rsnapshot to take
snapshots for very specific points in time, it would be worthwhile to
verify that you have an actual business need for that.

Also, note that there is no set of moving-snapshots-between-intervals which
can simultaneously preserve snapshots for Sunday, the first day of the
month, and the first day of the year. You'll need additional logic to make
copies. At which point you might as well either have separate rsnapshot
configs for the intervals you really want. Perhaps you could have one
config setup to sync first, then other configs to copy their intervals from
that copy.

-scott

Loading...