Print files which would be transfered by rsync (when syncing two directories)

Wayne Davison 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>
wrote:

> <code>
> X=`mktemp`
> echo "abc" > $X/1
> echo "abc1" > $X/2
> Y=`mktemp`
> echo "abc" > $Y/1
> echo "abc2" > $Y/2
> </code>

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).

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20140616/98177881/attachment.html>


More information about the rsync mailing list