The --inplace is very different from the behaviour of --partial when resuming a complex case transfer.

Hongyi Zhao hongyi.zhao at gmail.com
Tue Apr 14 04:01:43 MDT 2015


Hi all,

>From the manpage of rsync, I can see the following descriptions:

        --inplace
          The option implies --partial (since an interrupted transfer does
           not  delete  the  file)

So I do the following testings on the `--inplace' and `--partial' for 
resuming a file with the following steps:

1- rsync ftp.cn.debian.org::debian/dists/wheezy/main/binary-amd64/
Packages.gz .

2- split -b 1M Packages.gz

At this point, I obtained the following eight files:

 xaa  xab  xac  xad  xae  xaf  xag  xah

3- Then I remove two files, say, xab, and xae from the above eight files, 
and then use cat to regenerate the Packages.gz:

for i in  xaa  xac  xad xaf  xag  xah ; do
  cat $i >> Packages.gz;
done

4- Resuming the rsync transfer with the `--inplace' and `--partial' 
respectively for updating the Packages.gz file to its correct version:

$ rsync --inplace --progress  -v ftp.cn.debian.org::debian/dists/wheezy/
main/binary-amd64/Packages.gz .
[snipped]

Packages.gz
      7,625,173 100%  101.07kB/s    0:01:13 (xfr#1, to-chk=0/1)

sent 14,201 bytes  received 6,581,416 bytes  86,217.22 bytes/sec
total size is 7,625,173  speedup is 1.16

At this point, I delete the Packages.gz, and regenerate it with the 
commands:

for i in  xaa  xac  xad xaf  xag  xah ; do
  cat $i >> Packages.gz;
done

And then run the following commands:

$ rsync --partial --progress  -v ftp.cn.debian.org::debian/dists/wheezy/
main/binary-amd64/Packages.gz .
[snipped]
Packages.gz
      7,625,173 100%  177.44kB/s    0:00:41 (xfr#1, to-chk=0/1)

sent 14,201 bytes  received 2,112,951 bytes  45,745.20 bytes/sec
total size is 7,625,173  speedup is 3.58

As you can see, for my case, the Packages.gz file lacks 2M = 2097152 
bytes, and the with the `--inplace' method, the rsync will retrieve  
6,581,416 bytes to update this file to its correct version.  While with 
the `--partial' method, the rsync will only retrieve 2,112,951 bytes for 
updating the file to its correct version.

So, I cann't figurine out why the manual of rsync say that the `--inplace' 
implies `--partial'?

Any I also suspect that why the `--inplace' method is so inefficient,  as 
you can see, in this case, it will almost re-transfer the whole file for 
only updating a small part of this file.

While the `--partial' method will work smoothly.  The 2,112,951 bytes is 
only a little larger than the actual data for updating the file.  Of 
course, the control data are needed for rsync to work, so it will need a 
little more data for that thing.  So this method is worked just as the 
description in the manual. 

Any hints on the above issues?

Regards
-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.



More information about the rsync mailing list