symlinks that become directories question

rob at rob at
Mon Oct 29 17:15:46 GMT 2007

If I have a backup script that does the following:
(latest 2.6.9 rsync)

rsync --archive --hard-links --force --ignore-errors --numeric-ids 
--keep-dirlinks --delete / /backup

I've found that if there is a symlink in place that gets backed up (which 
goes fine), i.e.:
homelink -> /home/

and then that symlink gets changed into an actual directory, i.e.:
rm homelink
mkdir homelink

rsync will actually delete everything in the directory that the symlink 
pointed to (in the above case it deletes /home).

Is the workaround to use --delete-after to avoid this behavior, or is my 
logic flawed in using rsync with the command above to produce a mirror 
copy of an entire server to a backup drive? Thanks.


More information about the rsync mailing list