We have an odd problem with the rsync 2.6.6. When we issue rsync -vvrLxHpogDtSP server::image/ / it deletes certain directories. We're sync'ing to / because we don't know ahead of time which files will appear on the server. For example, some init scripts get populated into the rsync module, appearing ultimately as server::image/etc/init.d/script, but we don't know ahead of time which scripts will show up. When we issue the above commands, rsync removes the /etc/init.d directory altogether, and recreates it with only the scripts in the module, thereby removing all of our existing init scripts. [We have checked, and the inode number for /etc/init.d changes.] This is not the desired behavior - what we want to do is add the contents of the module to our existing files, without removing any of them. When we simplify the command line down to rsync -r server::images/ / it still clobbers /etc/init.d. For reference, this is under Fedora Core 3, Linux kernel 2.6.9-1.681_FC3. Does anyone have any idea why rsync is clobbering our files? Thanks! Liam
On Thu, Oct 20, 2005 at 02:56:42PM -0400, Liam Steacker wrote:> When we issue the above commands, rsync removes the /etc/init.d > directory altogether, and recreates it with only the scripts in the > module, thereby removing all of our existing init scripts.What probably happened was that /etc/init.d was a symlink (e.g. on Red Hat /etc/init.d is a symlink to rc.d/init.d). If this is a directory on the source system, rsync will remove the symlink and replaced it with the directory. You have two solutions: The best solution is to use the same symlinked directory structure in your modules as in your destination dirs. Alternately, you could use the --keep-dirlinks option to tell rsync to treat a symlink to a directory as if it were an actual directory. ..wayne..
Wayne Davison wrote:>On Thu, Oct 20, 2005 at 02:56:42PM -0400, Liam Steacker wrote: > > >>When we issue the above commands, rsync removes the /etc/init.d >>directory altogether, and recreates it with only the scripts in the >>module, thereby removing all of our existing init scripts. >> >> > >What probably happened was that /etc/init.d was a symlink (e.g. on Red >Hat /etc/init.d is a symlink to rc.d/init.d). If this is a directory on >the source system, rsync will remove the symlink and replaced it with >the directory. > >You have two solutions: The best solution is to use the same symlinked >directory structure in your modules as in your destination dirs. >Alternately, you could use the --keep-dirlinks option to tell rsync to >treat a symlink to a directory as if it were an actual directory. > >..wayne.. > >Wayne you are once again spot on, thank you very much.> > >
Maybe Matching Threads
- Prevent dereferenced path of symlinked directories from printing on client side log output
- symlinks that become directories question
- --keep-dirlinks --delete erroneously deletes symlinks to directories
- rsync deleting symbolic link unexpectedly
- error on --copy-dirlinks shortform in manpage