--append and then --append-verify will not work.

Hongyi Zhao hongyi.zhao at gmail.com
Sun Apr 5 19:58:45 MDT 2015

Hi all,

I do some testings on rsync by using the following method:

1- rsyning the following file with rsync:

rsync rsync://ftp.cn.debian.org/debian/dists/Debian7.8/main/binary-all/
Packages.bz2 .

2- Then I split the file into little files with the file size equaling to
128K, which is the maximum of the block-size accepted by rsync.

split -b 128K Packages.bz2

And at this point, I obtained the following 20 files:

werner at debian:~/http_resume_test$ ls x*
xaa  xac  xae  xag  xai  xak  xam  xao  xaq  xas
xab  xad  xaf  xah  xaj  xal  xan  xap  xar  xat

Then I delete some files, say, xab and xae, from the above little
files, and then use the cat tool to regenerate the Packages.bz2 by only
using the remaining little files:

werner at debian:~/http_resume_test$ for i in `ls x*`; do cat $i >>
Packages.bz2; done

3- Then, I re-run rsync with the following commands to syncing on the
above re-generated Packages.bz2 file for testing:

$ rsync -v -B131072 --append rsync://ftp.cn.debian.org/debian/dists/
Debian7.8/main/binary-all/Packages.bz2  .


sent 47 bytes  received 577,028 bytes  230,830.00 bytes/sec
total size is 2,541,616  speedup is 4.40

$ rsync -v -B131072 --append-verify rsync://ftp.cn.debian.org/debian/
dists/Debian7.8/main/binary-all/Packages.bz2  .


sent 28 bytes  received 1,381 bytes  563.60 bytes/sec
total size is 2,541,616  speedup is 1,803.84

4- Finally, I use diff to see the differences between the original
Packages.bz2 file the the one generated by the above two rsyncing runnings
with --append and --append-verify options.

Note, in the following command, the ~/Packages.bz2 is the original
Packages.bz2 file directly obtained from http://ftp.cn.debian.org/debian/

werner at debian:~/http_resume_test$ diff Packages.bz2 ~/Packages.bz2
Binary files Packages.bz2 and /home/werner/Packages.bz2 differ

As you can see, the finally file obtained by --append then --append-
verify is a wrong file which is differ from the original one.

5- In the above test, if I only running the following command to re-
rsyncing on the re-gererated Packages.bz2:

$ rsync -v -B131072 --append-verify rsync://ftp.cn.debian.org/debian/
dists/Debian7.8/main/binary-all/Packages.bz2  .

The result file will be correct, see following for detail:

werner at debian:~/http_resume_test$ diff Packages.bz2 ~/Packages.bz2
werner at debian:~/http_resume_test$

Any hints on this issue?


Hongyi Zhao <hongyi.zhao at gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20150406/eea696f9/attachment.html>

More information about the rsync mailing list