in reply to Re: copy only modified remote files
in thread copy only modified remote files

Thank you for your reply. I am just trying to understand which is more reliable/fast: checksum or mtime. The idea is that I want to check if the remote file was modified, before i copy it locally (to save up time). Also, is it possible to do checksum of the remote file before copying it locally? Thanks

Replies are listed 'Best First'.
Re^3: copy only modified remote files
by Laurent_R (Canon) on Jul 07, 2015 at 14:13 UTC
    mtime will be faster in most if not all cases, much faster if your files are large.
Re^3: copy only modified remote files
by stevieb (Canon) on Jul 07, 2015 at 14:13 UTC

    First, yes you can check on the remote system and there are a few ways you can do that. One is SSH into the remote machine, run a perl one-liner (or remote script) on the remote box to report back the mtime (or checksum).

    Getting a checksum would likely be quicker, but consider that you'll have to store the checksums somewhere then look them back up every program run for comparison, so that's likely to even things out.

    EDIT: per Laurent_R, mtime will be faster in the long run. I was testing on a miniscule few-byte file.

    -stevieb