G'day Lady Aleena,

The answer is going to depend on the size of your files and how many of them have changed; however, unless you have masses and masses of data to backup any only a very, very tiny amount hasn't changed, I would be extremely surprised if the time taken by calls to stat was in any way a limiting factor compared to the amount of time taken to move data between drives (C: to J:). So, while I don't have details on your data, either in terms of size or modifications, I would generally expect an incremental backup to take less time than a full backup.

You could speed up your script a bit by removing the get_mod_time() subroutine and rewriting same_mod_time() as:

sub same_mod_time { (stat($_[0]))[9] == (stat($_[1]))[9] }

However, the backup process is I/O bound and I doubt that would really have any noticeable affect.

If you're interested, here's my test for that code:

-- Ken


In reply to Re: Will checking last modified date take more time than just overwriting? by kcott
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.