Bug 5528 - rsync deletes files it shouldn't even look at!
rsync deletes files it shouldn't even look at!
Status: CLOSED FIXED
Product: rsync
Classification: Unclassified
Component: core
3.0.3
Sparc Solaris
: P3 major
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-09 08:38 UTC by CK
Modified: 2008-07-28 20:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CK 2008-06-09 08:38:34 UTC
Looked at the "NOTABLE CHANGES" section in 3.0.0 but i didn't see anything that sounded like this should work differently:

$ rm -rf /tmp/RTEST ; mkdir -p /tmp/RTEST/SRC /tmp/RTEST/TARGET/foo
$ /z/pkgs/rsync-2.6.9/bin/rsync -v -a --ignore-existing --delete /tmp/RTEST/SRC/ /tmp/RTEST/TARGET/oink
building file list ... done
./

sent 76 bytes  received 26 bytes  204.00 bytes/sec
total size is 0  speedup is 0.00

^^^^^ As expected.

$ rm -rf /tmp/RTEST ; mkdir -p /tmp/RTEST/SRC /tmp/RTEST/TARGET/foo
$ /z/pkgs/rsync-3.0.3pre2/bin/rsync -v -a --ignore-existing --delete /tmp/RTEST/SRC/ /tmp/RTEST/TARGET/oink
sending incremental file list
deleting foo/

sent 39 bytes  received 12 bytes  102.00 bytes/sec
total size is 0  speedup is 0.00

^^^^^ ARG!!!

Note that /tmp/RTEST/SRC/ needs to be empty and /tmp/RTEST/TARGET/oink mustn't exist for this to happen.
Comment 1 Wayne Davison 2008-06-09 09:53:36 UTC
This was caused by the transfer having just a single directory in it, and the delete-during code wasn't using the "solo-file" alternate directory name.

The git repository now has a fix for this.  Thanks for the report!