--delete --force Won't Remove Directories With Dotnames

Sabahattin Gucukoglu mail at sabahattin-gucukoglu.com
Thu Mar 8 17:02:21 GMT 2007

Hi Matt,

On 2 Mar 2007 at 10:37, Matt McCutchen <hashproduct+rsync at gmail.com> said:

> On 3/2/07, Sabahattin Gucukoglu <mail at sabahattin-gucukoglu.com> wrote: >
> --delete --force Won't Remove Directories With Dotnames > > if you remove a
> > directory which was aborted in a recent transfer on source (leaving a >
> .partial mirror at dest) the .partial directory won't go away on next >
> rsync, ever. > > Example: rsync --partial-dir=.partial /foo /bar.  Abort
> the transfer, and > /foo/biguns/bigfile gets left in
> /bar/foo/biguns/.partial/bigfile.  Now > remove /foo/biguns and do the
> transfer again, to completion.  The > /bar/foo/biguns/.partial/bigfile is
> still there.
> Rsync is leaving .partial around because it's a partial dir, not
> because its name begins with a dot.

Right, yep, I've tested this and you're right.  However, rsync is still 
never making any mention of the .partial directories in the output during 
the list build or sync (even with -vv, and I think even this would be a 
courtesy indicator).

> As the explanation of --partial-dir in the man page says, to get rsync
> to delete old partial dirs, supply your own rule --filter='R .partial/'
> and use --delete-after to avoid deleting partial dirs until after rsync
> has gotten what it needs from them. 

Thanks!  I *honestly* never saw this in the manual before.  Maybe it was 
never there (I started out with rsync 2.6.6).  This answer works but to me 
still seems ... not elegant.

> Maybe rsync should automatically delete a directory's partial dir when it
> finishes processing files immediately in that directory.

What possible reason does rsync have for leaving them around?  Not to do 
so means excluding a directory from deletion even when this is merely an 
aid to implementation, rather than the function of rsync with --delete

I won't yet update rsync as this is packaged and isn't easy to install 
cleanly if patched (this is Gentoo, for which rsync is a rather necessary 
piece of software :-) ) but if I get a chance I'll have a look at the new 
implicit rule stuff and see what I can make of it.  For now I can just 
search for the .partial directories.

Thanks for your help.


Sabahattin Gucukoglu <mail<at>sabahattin<dash>gucukoglu<dot>com>
Address harvesters, snag this: feedme at yamta.org
Phone: +44 20 88008915
Mobile: +44 7986 053399

More information about the rsync mailing list