Bug 6893 - the symbolic link to the directory is gone when only some of the files are to be sync'ed
Summary: the symbolic link to the directory is gone when only some of the files are to...
Status: RESOLVED INVALID
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.6
Hardware: x86 Linux
: P3 critical (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-12 23:14 UTC by Alan
Modified: 2009-11-12 23:23 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 Alan 2009-11-12 23:14:45 UTC
How to reproduce
================

Suppose we have hosts "src" and "dst" and we have 
   testfolder/
   test -> testfolder/
under /home and 

[root@heron home]# ll /home/test/
total 0
-rw-r--r-- 1 root root 0 Nov 13 15:29 a
-rw-r--r-- 1 root root 0 Nov 13 15:29 b
-rw-r--r-- 1 root root 0 Nov 13 15:29 c

we have file test.list which has contents below:
   /home/test/a

Now we run on host "src" following command:
   rsync -avzog -r --super -e ssh --files-from=test.list --delete / dst:/

then rsync will ignore the fact that /home/test is a valid softlink to an existing directory on "dst" and will remove it and create a new directory "test" with file "a" underneath.

This is serious. For example if you only want to sync "smb" script under /etc/init.d, you'll end up with a new /etc/init.d with only "smb" inside it on the target machine because normally /etc/init.d->/etc/rc.d/init.d. Then you won't be able to boot up the system.
Comment 1 Matt McCutchen 2009-11-12 23:23:08 UTC
This is the expected behavior unless --no-implied-dirs or --keep-dirlinks is used.  See the description of --no-implied-dirs in the man page.