partial-dir not being used?!

Carlos Carvalho carlos at
Thu Jul 16 23:13:00 MDT 2009

Matt McCutchen (matt at wrote on 16 July 2009 20:59:
 >On Thu, 2009-07-16 at 01:48 -0300, Carlos Carvalho wrote: 
 >> What's the purpose of --partial-dir then? I thought it was leaving the
 >> partial transfer as path/partial/filename instead of
 >> path/.filename.random. That's what it tried to do but this isn't fine
 >> if it needs another move. If rsync is killed with STOP or the machine
 >> crashes this partial will be lost? That doesn't look very useful.
 >It's fine and useful if rsync is killed with INT or TERM or hits a fatal
 >error (e.g., dropped connection).

Yes but will leave a lost partial in the tree if it's killed by KILL
(I meant kill above instead of stop) or the machine crashes. If it
used the partial dir the partial file would be where one expects to
find only partials.

 >I believe the reason why rsync doesn't create the file in the partial
 >dir from the start is that it may be using an old partial file as a
 >basis for a delta-transfer.  Rsync can't just append to the old partial
 >file because, in general, the beginning of the source file might have
 >changed since the old partial file was created. 

There can be several partials in the partial dir for the same file,
resulting from more than one interruption. rsync can always use the
more recent one as basis to proceed.

 >> How can we make rsync put the partial in path/partial/filename during
 >> the transfer?
 >I think the current behavior is reasonable.

It is but it seems it could be better with apparently no

 >You're always welcome to modify your own copy of rsync.

I've worked around it by also setting --temp-dir. If rsync is
interrupted by a catchable signal it moves the portion to partial-dir,
if not next time it finds the partial in temp-dir and can continue
from there. Also, no dot files are left in the destination tree. It
requires one extra move for each file, which also happens with
partial-dir anyway, so I got what I wanted. However, if the temp-dir
is not on the same filesystem then it gets really bad because it
requires a full copy so your disk IO will be doubled. With the partial
directly in partial-dir this wouldn't happen.

More information about the rsync mailing list