You are getting the directory path since that directory differs in its timestamp or user/group settings or permissions compared to the directory at the target.
To stop rsync
from looking at the directory timestamps, use the --omit-dir-times
flag:
rsync -avc -n --omit-dir-times "$source/" "$target"
Note that rsync
will not show the absolute paths of the files and directories, but the path relative to the top directory being transferred.
Using --itemize-changes
(or -i
) in place of --verbose
(or -v
), you get a lot more information about why a file is being updated on the target.
Example (with added annotations in the output):
$ rsync -ani s/ t
.d..t...... ./ # directory timestamp differs
>f+++++++++ file # new file
$ rsync -a s/ t
$ touch s/file
$ rsync -ani s/ t
>f..t...... file # file timestamp differs
$ echo hello >s/file
$ rsync -ani s/ t
>f.st...... file # file size and timestamp differs
$ rsync -acni s/ t
>fcst...... file # file size timestamp and checksum differs
$ rm s/file
$ rsync -acni s/ t
.d..t...... ./ # directory timestamp differs
$ rsync -acni --delete s/ t
*deleting file # file has been deleted in source
.d..t...... ./ # directory timestamp differs
See the documentation for the --itemize-changes
option in the rsync
manual on your system.