On 3/29/07, Mike Tishetsky <mike@funlay.com>
wrote:> I recently noticed strange behavior of rsync that is not fatal but is
rather
> annoying. During transfer if a symlink representing a directory exists on
> receiver, but is not created by rsync, rsync replaces that symlink with a
> normal directory. This is by default. To prevent this I should specify -K
> argument on sender. But I consider such behavior incorrect because if there
> is a symlink to directory already it should NOT be overwritten by regular
> dir in any case.
I disagree. If I replace a symlink with a real directory on the
sender, I expect rsync to make the same change on the receiver.
In any case, you can make -K the default on your computer. Just
rename the rsync executable to rsync1 and write a wrapper script rsync
that says:
#!/bin/bash
exec rsync1 -K "$@"
Matt