Why does rsync -an show files that are the same?

Matt McCutchen hashproduct+rsync at gmail.com
Mon Jun 5 14:18:23 GMT 2006


On Sun, 2006-06-04 at 14:06 -0500, Larry Alkoff wrote:
> I've tried both --itemize-changes and --relative and, in both cases, 
> rsync does not seem to be decending.  My command is now:
> script ~/inv/* ~/inv.orig/
> where script is:
> 
> rsync -uaHvn --relative --itemize-changes --modify-window=4000 
>           $1  $2

That call to script is definitely wrong.  If ~/inv contains two files
foo and bar, it will expand to:
	script ~/inv/foo ~/inv/bar ~/inv.orig/

$1 is ~/inv/foo and $2 is ~/inv/bar, so the rsync command expands to:
	rsync <options> ~/inv/foo ~/inv/bar

That can't possibly be what you want.  Just do this:
	script ~/inv/ ~/inv.orig/

It will copy files in ~/inv/ to the same names in ~/inv.orig/, which I
believe is what you want.  This command will also make it possible for
rsync to delete extraneous top-level files from ~/inv.orig/ if you pass
a --delete* option.  You might find it helpful to put "set -x" at the
beginning of your script to make bash print out each command before
executing it; that way you can see if the call being made to rsync is
what you intend.

If rsync still doesn't seem to be descending, try using double verbose
or double itemize-changes to get a list of all the files rsync considers
instead of just the ones transferred; this might shed light on the
problem.  Once you know rsync is considering all the files, change back
to single itemize-changes to see why it believes each file needs to be
updated.

Matt



More information about the rsync mailing list