Print files which would be transfered by rsync (when syncing two directories)
wayned at samba.org
Mon Jun 16 09:26:41 MDT 2014
On Mon, Jun 16, 2014 at 5:29 AM, Karl-Philipp Richter <krichter722 at aol.de>
> echo "abc" > $X/1
> echo "abc1" > $X/2
> echo "abc" > $Y/1
> echo "abc2" > $Y/2
I'll assume you meant to use -d on your mktemp commands (as another
responder *almost* pointed out).
> * `rsync --dry-run --info=COPY -r -c $X/ $Y/` # same as above with
> trailing slashes
This is almost the right command, you're just asking for the wrong info.
The trailing slashes are needed to properly tell rsync to just copy the
contents of the one dir to another without copying the directory by name
inside the transfer. If you had also asked for --info=NAME you'll have
gotten the names of the transferred files. The COPY info is for "files
copied locally on the receiving side", as in the case where you use
something like --copy-dest=DIR and rsync makes a copy of a local file
instead of transferring it from the sending side.
As for what the -n option does, it just tell rsync not to do any work. Any
output generated is only what you tell it to output, so -n is usually
paired with -v (--verbose).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rsync