I use rsync to bring files from multiple servers to a "master copy". Sometimes the same file has different content in different sources. What I want is to keep the last modified one. I wish rsync had something like --time-only (analogous to --size-only) so it could simply sync based on last modified time. Without something like that, rsync will keep overwriting the same files over and over again when syncing from different sources (if the size or checksum doesn't match).

Are there any better ways to do this kind of synchronization?

migrated from stackoverflow.com Sep 12 '11 at 11:42

This question came from our site for professional and enthusiast programmers.


Sounds like what you want it is rsync -u -- "skip files that are newer on the receiver".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.