-4

From manpage of rsync

-u, --update

This forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file. (If an existing destination file has a modification time equal to the source file's, it will be updated if the sizes are different.) Note that this does not affect the copying of dirs, symlinks, or other special files. Also, a difference of file format between the sender and receiver is always considered to be important enough for an update, no matter what date is on the objects. In other words, if the source has a directory where the destination has a file, the transfer would occur regardless of the timestamps. This option is a transfer rule, not an exclude, so it doesn't affect the data that goes into the file-lists, and thus it doesn't affect deletions. It just limits the files that the receiver requests to be transferred.

without -u,

Rsync finds files that need to be transferred using a "quick check" algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated.

Can you point out what differences are between using -u and not?

Does -u decide less files to be transferred than without -u, and therefore does the transfer take longer with -u than without -u?

Thanks.

2

Without -u it's simply: "If thing at source is different from thing at destination, make them same by copying from source to destination". Even if it means replacing newer things with older ones.

With -u this rule gets "... except if both things are the same type (file/symlink/device node/etc.) and the destination is newer than source, skip it" appended.

  • Thanks. (1) What does "Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated" mean? – Tim May 15 '18 at 11:10
  • (2) Does your " if both things are the same type (file/symlink/device node/etc.)" mean the same as "this does not affect the copying of dirs, symlinks, or other special files" in the manpage? – Tim May 15 '18 at 11:16

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.