[Bug 2024] New: --delete erase files on receiving side that EXIST on sending side

samba-bugs at samba.org samba-bugs at samba.org
Thu Nov 11 21:03:15 GMT 2004


           Summary: --delete erase files on receiving side that EXIST on
                    sending side
           Product: rsync
           Version: 2.6.2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: neva at nevalabs.org
         QAContact: rsync-qa at samba.org


According to rsync documentation:
              This  tells rsync to delete any files on the receiving side that
              arenât on the sending  side.    Files  that  are  excluded  from
              transfer   are  excluded  from  being  deleted  unless  you  use

If I run rsync in daemon mode, and use a configuration file, files excluded in
the configuration file are correctly excluded from transfer, but they ARE
DELETED on receiving side.


I have these files:

# ls -1 src/

# ls -1 dest/

#cat rsyncd.conf
pid file = /var/run/rsyncd.pid
use chroot=false

exclude=- *.no + *.yes - *

server command line:
#rsync --daemon --no-detach --config=./rsyncd.conf

client command line (1):
#rsync -n -avz --delete dest

client command line (2) - works as expected:
#rsync -n -avz --delete --exclude='*.no' dest

When I run (1), I have the following output:

# rsync -n -avz --delete dest
receiving file list ... done
deleting copy.no

wrote 78 bytes  read 120 bytes  396.00 bytes/sec
total size is 0  speedup is 0.00

When I run (2), I get this:

# rsync -n -avz --delete --exclude='*.no' dest
receiving file list ... done

wrote 86 bytes  read 120 bytes  412.00 bytes/sec
total size is 0  speedup is 0.00

Conclusion: Probably when files are excluded in a configuration, these are
really not counted as excluded files for the --delete option, so even if they
are excluded in configuration file, they will be deleted if --delete is used.

Versions affected: at least 2.5.7 and 2.6.2

For being able to better test this bug, you can download this tar.gz file:

This problem was discovered using ssh with a remote host, but I simplified the
example to make it easier to reproduce the problem.

If any additional info is needed, please contact me.

Claudio Neves

Claudio Neves - System Administrator
Next Internet Solutions - Sao Paulo/Brazil
Phone: +55-11-5579-6966

Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list