Bug or feature? --delete-after + symlinks

John Van Essen vanes002 at umn.edu
Tue Jan 7 05:54:00 EST 2003


On Mon, 06 Jan 2003, J. Milgram <milgram at cgpp.com> wrote:

>sorry if this is old stuff, but I did my best to look first...
>
>Have been getting errors along these lines:
>
>mv mydir mdir.2002
>ln -s mydir.2002 mydir
>
>Then update mirror with rsync -av --delete-after. Without
>--delete-after, no problem, with --delete-after, get a code 23.
...
>delete_file: rmdir(a/b) : Directory not empty
>rsync: symlink "a/b" -> "b.1": File exists

[ snip ]

Hi J.,

My recent reply to someone else about deleting non-empty directories 
that have been replaced with a symlink may have the info you need:

----- Forwarded message begins here -----
From: John Van Essen <vanes002 at umn.edu>
Date: Mon, 6 Jan 2003 02:05:47 CST
Subject: Re: directories that change into symlinks

What you need is the --force option.  It's not obvious from the
all-too-generic name, but that will do the trick.

To the rsync maintainers - this is somewhat of an FAQ.  Perhaps
the error message could also say '(see the --force option)' to
help users discover the solution more easily.

------ Forwarded message ends here ------

Although, I'm not sure why there are 'no problems' when you don't
use --delete-after...   It should still be trying to replace the
directory with the symlink even if no --delete* options are used,
and you should still need to use --force to get it to delete the
existing non-empty directory.
-- 
        John Van Essen  Univ of MN Alumnus  <vanes002 at umn.edu>
        3DGamers  Systems Software Support  <jve at 3dgamers.com>




More information about the rsync mailing list