Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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.


In reply to Re: Curve fitting for rsync snapshot deletion by atcroft
in thread Curve fitting for rsync snapshot deletion by mhearse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (8)
    As of 2014-07-28 15:34 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (203 votes), past polls