Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Curve fitting for rsync snapshot deletion

by atcroft (Monsignor)
on Nov 21, 2013 at 18:05 UTC ( #1063767=note: print w/replies, xml ) Need Help??

in reply to Curve fitting for rsync snapshot deletion

I was trying to visualize what you are intending. Are you taking '2013-11-21 17:50:42 +0000', converting it to epoch (1385056242), then attempting to find if it is a square number, and deleting if not? And you are doing the backups on 15m intervals, so you are looking for sqrt(15*$m + $d) == int(sqrt(15*$m + $d))? For the time given above, the previous and two following times that would meet the criteria are:

Thu Nov 21 10:44:16 2013 (37216) Fri Nov 22 07:24:49 2013 (32717) Sat Nov 23 04:05:24 2013 (32718)
The only ways I could see that working are either:
  1. you start at the oldest, deleting until you reach your threshold or a lower limit of versions to keep, or
  2. you look to see if backup falls into some kind of interval that agrees with your idea (for instance, it is the closest backup to the actual time that matches).

Personally, if you are not already using it I would probably look at using --link-dest=DIR option, where you give each backup run the directory of the previous as the parameter for this option. If the files match, then they are hard-linked, so (on *nix systems, at least) they only add a directory entry in the new directory.

Hope that helps.

Replies are listed 'Best First'.
Re^2: Curve fitting for rsync snapshot deletion
by mhearse (Chaplain) on Nov 21, 2013 at 21:19 UTC
    Thanks for your post. Yes, I am invoking rsync via: --link-dest=DIR. I'm wanting to avoid deleting from the oldest... and instead have a parabolic representation of time (snapsnots)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063767]
[marto]: hey Corion, good weekend?
[Corion]: marto: Yeah, even though I didn't write any code :)
[Corion]: But at least I have a plan of action to move the site to https, played some (free!) VR games with friends and watched the plans for the next German Perl workshop progress ;)
[Corion]: AltSpace VR is amazingly good - highly polished and with some of the games you get for free what you'd pay EUR 20 or EUR 40 otherwise
[Corion]: But maybe it's also due to that I play with friends, which makes a game more enjoyable anyway ;)
[Corion]: Oh - I released a new version of some module, thanks to a pull request. But I don't consider "update Makefile.PL" and "update author tests" as "writing code" ;-D

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-08-21 09:24 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (319 votes). Check out past polls.