--delete bug?
Wayne Davison
wayned at samba.org
Fri Aug 15 02:36:55 EST 2003
> Joost Ruijsch wrote:
> ># rsync -aRxW --delete / /mnt/backup
> >Today I got errors because the target drive was full. It appeared
> >nothing on the targed drive ever got deleted.
Yes, it appears that it is your use of -R with a source of '/' that
combine to cause the delete failure. This causes rsync to not send the
"." dir, so we don't treat it like a send of an entire directory, and
thus no files are deleted.
On Sun, Apr 27, 2003 at 02:16:32PM +0200, Joost Ruijsch wrote:
> I found this comment in flist.c :
>
> if ((l == 2) && (fname[0] == '.')) {
> /* Turn ./ into just . rather than ./.
> This was put in to avoid a problem with
> rsync -aR --delete from ./
> The send_file_name() below of ./ was
> mysteriously preventing deletes */
> fname[1] = 0;
> } else {
> strlcat(fname, ".", MAXPATHLEN);
> }
If I change the code immediately above the code you cited to allow a
string of length 1 into it (i.e. a "/" all by itself), then the delete
bug goes away. I don't know yet if that has any adverse effects,
though.
> With some experimenting I found something that does work, using a
> double slash instead of a single:
Yeah, since that gets expanded to "//.", which sends a directory. It
would also work to use "/." directly. Also, you can just leave off the
-R option (since it doesn't actually do anything from a "/" path).
While testing this, I noticed that -R mode combined with an --exclude
that would exclude the "." directory can prevent the transfer of any
files from within a directory. This is something else that should be
fixed.
I'll look into this more later.
..wayne..
More information about the rsync
mailing list