Hi Milady

In general terms, I would think that checking the last modification date will almost always be better than simply overwriting files (checking the last modification time is a very fast system call), although it is true that it really depends on the number of files, the file size, the modification frequency and factors more complicated to take into account (for example: are the large files more likely to be modified than the small one, or is it the opposite? etc.)

Another point: if I understood correctly your code (which I read only very quickly), you are comparing the file last modification time with the same parameter on the backed up file. You should probably have a small database (a tied hash, whatever) so that you don't need to check the back up last modification time. In fact, it can be even simpler: you only need to remember the last time you ran a backup. Any more recently modified file needs to be backed up, any older file needs not.


In reply to Re: Will checking last modified date take more time than just overwriting? by Laurent_R
in thread Will checking last modified date take more time than just overwriting? by Lady_Aleena

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.