I have binary file which has approx 77MB:nupic@nupic-virtualbox:~/VboxSharedFolder/experiments/sync/exp2$ ls -lah src/total 77Mdrwxrwx--- 1 root vboxsf    0 Jun 21 13:31 .drwxrwx--- 1 root vboxsf 4.0K Jun 21 16:21 ..-rwxrwx--- 1 root vboxsf  77M May 27  2014 binary.binI've been playing with rsync and it's delta algorithm feature to see how it is working. Idea was to make small differences in binary file and see how much data were transferred using several methods. For those purposes I've made very simple script:#!/bin/bash# rsync does not trnansfers delta over local by defaultsed 's%\x00\x00\x00\x20\x66\x74\x79\x70\x69\x73\x6f\x6d\x00\x00\x02\x00%\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11%' src/binary.bin > dst/binary.binstrace -f -e trace=read,write -o rw_rsync_local_default.log rsync -avcz --progress src/ dst/# rsync -no-W should enables delta tranfer no matter if local or remotesed 's%\x00\x00\x00\x20\x66\x74\x79\x70\x69\x73\x6f\x6d\x00\x00\x02\x00%\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11%' src/binary.bin > dst/binary.binstrace -f -e trace=read,write -o rw_rsync_local_delta_enabled.log rsync --no-W -avcz --progress src/ dst/# rsync trnansfers delta over network by defaultsed 's%\x00\x00\x00\x20\x66\x74\x79\x70\x69\x73\x6f\x6d\x00\x00\x02\x00%\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11%' src/binary.bin > dst/binary.binstrace -f -e trace=read,write -o rw_rsync_remote.log rsync -avcz -e ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --progress src/ nupic@localhost:/home/nupic/VboxSharedFolder/experiments/sync/exp2/dst/# scp should transfers whole file not deltased 's%\x00\x00\x00\x20\x66\x74\x79\x70\x69\x73\x6f\x6d\x00\x00\x02\x00%\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11%' src/binary.bin > dst/binary.binstrace -f -e trace=read,write -o rw_scp.log scp src/binary.bin nupic@localhost:/home/nupic/VboxSharedFolder/experiments/sync/exp2/dst/# cp always transfers whole file not deltased 's%\x00\x00\x00\x20\x66\x74\x79\x70\x69\x73\x6f\x6d\x00\x00\x02\x00%\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11%' src/binary.bin > dst/binary.binstrace -f -e trace=read,write -o rw_cp.log cp src/binary.bin dst/binary.binThen I have following loop for evaluation of results:for i in *.log; do  echo $i; cat $i | grep write | awk 'BEGIN {FS==}{ sum += $2} END {print sum/1024/1024 MB}';  echo ###########;doneHere are results:rw_cp.log67.8075MB###########rw_rsync_local_default.log146.697MB###########rw_rsync_local_delta_enabled.log66.8765MB###########rw_rsync_remote.log0.0707941MB###########rw_scp.log136.048MB###########From those five experiments only two are clear to me:cp writes approx same amount of bytes as the size of originalfile (rw_cp.log).rsync uses delta algorithm when destination is remote (over the network) (rw_rsync_remote.log)And here are unclear things to me:Why invoking rsync on both src and dst on localhost writes approxtwo times bytes as the size of original file? (rw_rsync_local_default.log)Why --no-W option for rsync does not transfer only delta for src and dst on localhost as stated here and why it still transfers approx whole file? (rw_rsync_local_delta_enabled.log)Bonus: Why scp transfers approx twice bytes as original file size? I understand that there is some encryption but two times seems large to me (rw_scp.log).
why rsync does not do delta transfer
rsync;scp