Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Will checking last modified date take more time than just overwriting?

by Laurent_R (Parson)
on Aug 19, 2013 at 20:24 UTC ( #1050085=note: print w/ replies, xml ) Need Help??


in reply to Will checking last modified date take more time than just overwriting?

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.


Comment on Re: Will checking last modified date take more time than just overwriting?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050085]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-10-25 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (145 votes), past polls