Two bugs in rsync (--dry-run and --delete-excluded)

Norbert Preining preining at logic.at
Fri Mar 12 21:02:05 GMT 2004


Hi rsync gurus!

[Please Cc: me, as I am NOT subscribed to the list!]

First the data points:
debian/woody, local server=i386 arch, remote is alpha arch
rsync version on both debian 2.5.5-0.2

While upgrading our server to a raid we were hit by a bug which I really
consider very strange:

The option -n/--dry-run does NOT change files, but DELETE files when
called with --delete.

Test case I had:
$ ls rsynctest/
changedfile deletedfile
$ cat rsynctest/changedfile
a
b
$ export SSHKEY="/root/.ssh/mirrorkey.id_dsa"
$ export RSYNC_RSH="ssh -2 -i $SSHKEY"
$ rsync -az -q --one-file-system --delete --delete-excluded --exclude-from=/etc/mirror/beta-test/exclude /home/assoc/preining/rsynctest remote.host.dom:/mirror

After this I have exactely these file on the remote host.

$ rm rsynctest/changedfile
$ echo a > rsynctest/changedfile

Now do a --dry-run test
$ rsync -az -v --dry-run --one-file-system --delete --delete-excluded --exclude-from=/etc/mirror/beta-test/exclude /home/assoc/preining/rsynctest remote.host.dom:/mirror

(The other options are from the script)
and I get
Invalid file index 700 (count=2)
rsync error: protocol incompatibility (code 2) at sender.c(126)



BUT: 
* deletedfile is DELETED!
* changedfile is NOT changed!

This is dangerous (and in fact killed a lot of work here!)



Additionally, there is a very strange behaviour:

When I LEAVE OUT the --delete-excluded rsync hangs indefinitely:
$ rsync -az -v  --one-file-system --delete /home/assoc/preining/rsynctest beta.logic.tuwien.ac.at:/mirror/
building file list ... done
rsync error: received SIGUSR1 or SIGINT (code 20) at rsync.c(229)
$



This all looks *very* strange to me. Could you please enlighten me on
what's the problem?

[Please Cc: me, as I am NOT subscribed to the list!]

Best wishes

Norbert

-------------------------------------------------------------------------------
Norbert Preining <preining AT logic DOT at>         Technische Universität Wien
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BUDBY
A nipple clearly defined through flimsy or wet material.
			--- Douglas Adams, The Meaning of Liff


More information about the rsync mailing list