DO NOT REPLY [Bug 5091] New: Incremental-recursive, list-only "rsync --delete" tries to clean out working dir

samba-bugs at samba-bugs at
Mon Nov 19 22:00:05 GMT 2007

           Summary: Incremental-recursive, list-only "rsync --delete" tries
                    to clean out working dir
           Product: rsync
           Version: 3.0.0
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: core
        AssignedTo: wayned at
        ReportedBy: matt at
         QAContact: rsync-qa at

In an empty directory, run:

mkdir src
rsync -r --delete src/

The result:

drwx------          48 2007/11/19 16:54:29 .
rsync: delete_file: rmdir(src) failed: Read-only file system (30)
rsync error: some files could not be transferred (code 23) at main.c(1059)

Rsync should not be trying to delete in list-only mode!  Thank goodness for the
check in syscall.c or I might have had some serious data loss.

The error occurs only when incremental recursion is in use.  The trouble is
that the call to delete_in_dir at generator.c:2051 is not conditioned on
!list_only .  To prevent more mistakes like this, it might make sense to set
dry_run to a large value in list-only mode.

Configure bugmail:
------- 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