DO NOT REPLY [Bug 3422] New: dry run fails when encountering dangling symbolic link

bugzilla-daemon at bugzilla-daemon at
Wed Jan 18 10:30:58 GMT 2006

           Summary: dry run fails when encountering dangling symbolic link
           Product: rsync
           Version: 2.6.4
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: core
        AssignedTo: wayned at
        ReportedBy: Peter.Englmaier at
         QAContact: rsync-qa at


I use rsync for backup and once in a while somebody replaces a symbolic link
with the contents of the file. In this case, I find that dry-run will
report errors while rsync without -n flag works fine.
A test case can be generated like this:

mkdir old
cd old
mkdir data
ln -s data link
cd ..
mkdir new
mkdir new/link
rsync -n -arlpogt --delete new/ old/

The rsync output will be:
building file list ... done
deleting data/
deleting link

Now when we delete data before, rsync fails:
rmdir old/data
rsync -n -arlpogt --delete new/ old/
building file list ... done
deleting link
rsync: opendir "/data1/ppe/tmp/old/link" failed: No such file or directory (2)

Rsync fails with return code 23, however, if you remove the '-n' flag,
rsync is able to sync and does not report errors. I think this is an error,
because dry-run should just report that the symbolic link is updated, i.e.:

building file list ... done

and return no error code. For me this is also a problem, because I build
scripts around rsync and I use dry-run for testing what will be done.
The script makes than a backup of the files which would be deleted. But
when dry-run fails, the script does not know whether its save to continue.
Best, Peter.

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