rsync compares all files again and again

Elliot Wilen ewilen at
Fri Oct 14 12:37:13 MDT 2011

Thanks, somehow I'd convinced myself that when I did a -vv, I could see larger files taking longer to "compare" than smaller files. But this was probably when actual syncs of those files were going on. Retest shows you're right, of course.

Frank's idea seems to be valid, though: why not compare the mtimes of directories and skip comparing the mtimes & sizes of files in those directories which haven't changed?

Note 1: It looks like you'd still have to compare subdirs even if their parent dirs don't have a change in mtime.

Note 2: Frank mentioned ctime but I think mtime is what you need to look at.

Elliot Wilen
Network Administrator/Postmaster
MPR Associates, Inc.
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: (510) 849-4942
Fax: (510) 849-0794

On Oct 14, 2011, at 11:08 AM, Kevin Korb wrote:

> Hash: SHA1
> Rsync doesn't compare every file over and over unless you tell it to or
> you don't tell it to sync timestamps (which is part of -a).  Otherwise
> it compares the file size and mtime.  If those are the same it assumes
> the contents are the same.
> The only reason you are getting a listing of all files is that you are
> using -v twice.  If you just use -iv you will only see files that rsync
> is doing something with and why rsync is doing something with them.

More information about the rsync mailing list