why does --size-only not detect change only is size (but also time)?

Matt McCutchen hashproduct+rsync at gmail.com
Thu Apr 19 01:59:04 GMT 2007


On 4/18/07, CSights <csights at fastmail.fm> wrote:
> My confusion is that when using --size-only only the size should be used by
> rsync to decide whether the files are different.  In this case the files'
> sizes are the same, but the times are different.  rsync must be looking at
> the files' times as well, which seems to contradict the manual page.

Just to drive the point home:

"Transferring" refers specifically to copying the *data* of a regular
file from sender to receiver and is only one of several things that
rsync can do to a file.  The others: rsync can "locally create" files
(usually only non-regular files), hard-link them, delete them, and
"tweak" their attributes.  The first character of an itemize line
tells you the kind of processing: ">" or "<" for a transfer, "c" for a
local creation, "h" for a hard link, "*" for a deletion, and "." for
none of the preceding.  Attribute tweaks are indicated by additional
letters after the file type letter.

The options --size-only, --checksum, and --ignore-times govern only
the "quick check", i.e., the decision of whether a regular file looks
up-to-date enough to not be transferred.  *Regardless of this
decision*, the file is considered for attribute tweaking in accordance
with the attributes you asked rsync to preserve.  This means that
attribute changes, such as your change to the mtime, will be
propagated whether or not they cause the quick check criterion you
selected to fail.

As Wayne said, -n is irrelevant.  The dry-run output reflects all the
actions (data transfer, attribute tweaks, or both) that rsync would
perform on a real run; it is considered a bug if the dry-run output
differs from the real-run output.  On a real run, the itemize line for
Untitled.pdf would still be ".f..t......", indicating that rsync did
not transfer it but did tweak the mtime.

Matt


More information about the rsync mailing list