rsync deleting directories when synchronizing

Wayne Davison
Thu, 20 Oct 2005 20:12:45 -0000

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..