<div dir="ltr">On Tue, Apr 2, 2013 at 12:07 PM, Brice Rebsamen <span dir="ltr"><<a href="mailto:brice.rebsamen@gmail.com" target="_blank">brice.rebsamen@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So what I want, is to be able to compare files this way:<br>
<br>
if the file does not exist at the destination, then transfer it with timestamps (rsync -t)<br>
otherwise:<br>
    if timestamps and sizes are different:<br>
        if md5sums match<br>
            if the source time stamp is earlier than the destination timestamp<br>
                update the timestamp of the destination<br>
        otherwise report (in a log file or something so that I can come back to those later)<br></blockquote><div><br></div><div style>You can use rsync to help with that, but it won't do it for you.  For instance, the first part can be done by specifying --ignore-existing (so that rsync just copies in missing files).  You could then get a list of files that differ in their timestamp by running a --dry-run with --itemize-changes.  If you use --checksum, it will differentiate between identical files and those that are different, but it will take a huge amount of time to checksum all files.  Instead, you may want to just have rsync list all the files that differ by time and you then put them into a --files-from file for rsync to check via --dry-run and --checksum.</div>

</div><div><br></div>..wayne..
</div></div>