rsync and the file's mtime

Wayne Davison wayned at users.sourceforge.net
Mon Nov 25 18:21:02 EST 2002


On Mon, Nov 25, 2002 at 09:30:03AM -0500, Jeff Bearer wrote:
> But if the file isn't modified, the modified time shouldn't be updated,

By default, rsync uses the time & size on the file to determine if it
was updated.  Since the source and destination files don't match, rsync
transferrs the file, and that updates the mtime.  There is no special
check to see if the newly created temp-file is identical to the existing
file -- the file is just updated.

If you use the -c (--checksum) option, rsync will switch to testing the
checksums of the files to determine if the file needs to be transferred.
This will cause the file not even to be sent unless it's changed, and
thus to preserve the destination file's current mtime when it is up-to-
date.

..wayne..



More information about the rsync mailing list