Partial transferred files useless at resume, compare-dir can help ?

Matt McCutchen hashproduct+rsync at gmail.com
Tue Jun 13 20:24:08 GMT 2006


On Tue, 2006-06-13 at 22:00 +0300, Constantin Teodorescu wrote:
> I heard about the --partial option in order to keep the partial 
> transferred file. I thought that rsync will apply his incremental check 
> and update alghoritm on that partial file and resume the transfer.
> 
> Unfortunatelly , the temporary file name is a unique file name ( 
> .mydb-dump.sql.bz2.MkVSHy ) and in the next transfer session it will be 
> another one  , so "partial" transfer files does not help me much.

If you use --partial and the transfer is interrupted, the receiving
rsync moves the partial file over the original when it dies, so the file
will be found on the next attempt.  However, you say you want an atomic
switch, so this won't do.

> Can "--compare-dir" help me?

No, but --partial-dir does exactly what you want.  Use something like
--partial-dir=.rsync-partial.  When the receiving rsync dies, it will
create a directory .rsync-partial and move the partial file
from .mydb-dump.sql.bz2.MkVSHy to .rsync-partial/mydb-dumb.sql.bz2.

On the next attempt, the receiving rsync will copy the data in the
partial file to a new temporary file and continue receiving data where
it left off.  If the transfer gets interrupted again, rsync will move
the new temporary file over the old partial file so it will be there for
the next attempt, etc.

Only when the complete file has been assembled on the receiver will
rsync move it over the original; then rsync will clean up after itself
by deleting .rsync-partial .

Matt



More information about the rsync mailing list