Print files which would be transfered by rsync (when syncing two directories)
hs at schlittermann.de
Mon Jun 16 07:23:17 MDT 2014
Karl-Philipp Richter <krichter722 at aol.de> (Mo 16 Jun 2014 14:29:04 CEST):
> Hi together,
> after I read "very often" without even a tiny bit of a contradiction, I
> start to have the feeling I have a basic misunderstanding of rsync.
> Assume one want to get a list of files which would have been transfered
> by rsync if rsync was requested to sync directories X and Y and one does
> echo "abc" > $X/1
> echo "abc1" > $X/2
> echo "abc" > $Y/1
> echo "abc2" > $Y/2
You ment 'mkdir -d'
> then I'd expect rsync to update the file $Y/2 with the content of $X/2
> and `rsync --dry-run --info=COPY -r -c $X $Y` should print $Y/2 (or
> $X/2, this isn't part of my problem), but it prints nothing. Further
> non-working solutions include:
> * `rsync --dry-run --info=COPY -r -c $X/ $Y/` # same as above with
The info-Option my rsync doesn't have.
> trailing slashes
> * `rsync -avun $SOURCE $TARGET`
> [http://unix.stackexchange.com/questions/57305/rsync-compare-directories] (printing
> both files or nothing (with and without trailing slashes))
$ rsync -avun $X $Y
sending incremental file list
> * `rsync -n $X $Y`
> which seems already false by intuition as rsync doesn't display
> separated file infos if not instructed to do so)
And $X and $Y are dirs, rsync won't recurse into dirs without using the
> Where is my misunderstanding and if there's none, how do I get rsync to
> print $X/2 (or $Y/2) in my example above?
That's what I use. The "killer option" is "-i"
$ rsync -n -ia $X $Y
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 847 bytes
Desc: Digital signature
More information about the rsync