Partial transferred files useless at resume, compare-dir can
help ?
Constantin Teodorescu
teo at flex.ro
Tue Jun 13 21:21:28 GMT 2006
Matt McCutchen wrote:
> 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.
>
I tried to simulate this by cutting the connection (remove the phone
cable from the modem).
If --partial is not specified , the temporary file (
.mydb-dump.sql.bz2.MkVSHy ) is erased and lost for ever.
If --partial is specified , the temporary file (
.mydb-dump.sql.bz2.MkVSHy ) is kept, and NOT MOVED OVER THE ORIGINAL
(TARGET FILE).
>
>> 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.
>
Tried that right from the first time , because it's written in the man
pages.
There is no .rsync-partial created there, the same (
.mydb-dump.sql.bz2.MkVSHy ) appears in the target directory , the same
thing is happening ! :-(
> 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 .
>
This is EXACTLY what I wanted , and tried for the first time , like in
the manual but no ... it's behaviour is not changed at all ! :-(
Teo
More information about the rsync
mailing list