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

Liesinger Horst Horst.Liesinger at doppelmayr.com
Tue Jun 17 04:43:42 MDT 2014


Hi Karl-Philipp

We use just Version 3.0.9 therefore I have no experience with option --info.
We normally use rsync --dry-run -rzpogctlS --log-format=%f $X $Y

I hope this will help you.

Best regards
Horst

-----Ursprüngliche Nachricht-----
Von: Karl-Philipp Richter [mailto:krichter722 at aol.de] 
Gesendet: Montag, 16. Juni 2014 21:51
An: Liesinger Horst
Cc: rsync at lists.samba.org
Betreff: Re: Print files which would be transfered by rsync (when syncing two directories)

Hi Horst,
thanks for the hint, I made this error because I assembled the <code>
block from command history (without testing it again...), but I tested
now that
<code>
X=`mktemp -d`
echo "abc" > $X/1
echo "abc1" > $X/2
Y=`mktemp -d`
echo "abc" > $Y/1
echo "abc2" > $Y/2
rsync --dry-run --info=COPY -r -c $X $Y
</code>
gives no output and
<code>
X=`mktemp -d`
echo "abc" > $X/1
echo "abc1" > $X/2
Y=`mktemp -d`
echo "abc" > $Y/1
echo "abc2" > $Y/2
rsync --dry-run --info=COPY -r -c -v $X $Y # same as above with -v
appended to option list
</code>
prints
<code>
$X/
$X/1
$X/2
</code>
which I don't understand.

Any clues with the corrected example?

Best regards,
Karl-P. Richter

Am 16.06.2014 15:31, schrieb Liesinger Horst:
> Hi Karl-Philipp,
> 
> you have to use mktemp -d ... -d for directory otherwise it creates a file.
> 
> Best regards
> Horst
> 
> -----Ursprüngliche Nachricht-----
> Von: rsync-bounces at lists.samba.org [mailto:rsync-bounces at lists.samba.org] Im Auftrag von Karl-Philipp Richter
> Gesendet: Montag, 16. Juni 2014 14:29
> An: rsync at lists.samba.org
> Betreff: Print files which would be transfered by rsync (when syncing two directories)
> 
> 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
> <code>
> X=`mktemp`
> echo "abc" > $X/1
> echo "abc1" > $X/2
> Y=`mktemp`
> echo "abc" > $Y/1
> echo "abc2" > $Y/2
> </code>
> 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
> 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 -rvnc --delete $X/ $Y/`
> [http://psung.blogspot.de/2008/06/comparing-directory-trees-with-diff-or.html]
> (basically the same as `avun`, but does the same)
>   * `rsync -n $X $Y`
> [http://superuser.com/questions/576687/rsync-print-only-files-that-would-have-been-changed]
> which seems already false by intuition as rsync doesn't display
> separated file infos if not instructed to do so)
> 
> 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?
> 
> Any help is appreciated :)
> 
> All the best,
> Kalle Richter
> 



More information about the rsync mailing list