files' timestamp handling - bug or design decision?

Amadeus R. jav9d2p02 at
Thu Mar 31 19:07:07 GMT 2005

> I want to be able to do two things together:
> -- transfer files from the source to destination only if the files'
> contents is changed

rsync -avr

Consider: -W -x --delete --delete-excluded --log-format='%i %f'

Use --dry-run when testing for the right configuration to avoid data loose.

> -- when the files are transfered, I want to preserve original timestamp

Try -a.

> By looking at the switches available in rsync, I assumed that a
> combination of --times and --checksum would do what I want, but
> apparently, --times not only tells rsync to preserve timestamps on
> transfer, but also to consider the files for the transfer if there is
> a discrepancy in the mtime of the files.

rsync's defaults is pretty sane, and does what you want in most cases. Try
rsync -avr --dry-run
and see, if this doesn't solve your needs.

More information about the rsync mailing list