Im not entirely sure about your phrasing, but it seems that you are asking for rsync to only copy the changes/deltas of a file rather than the whole file. I would do this like this:
Code:
rsync -varh --progress --inplace --no-whole-file source destination
-v, --verbose increase verbosity
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive recurse into directories
-h, --human-readable output numbers in a human-readable format
--inplace update destination files in-place
--no-whole-files copy file changes (with delta-xfer algorithm)
Here's how you can verify:
Code:
$ mkdir a b
$ dd if=/dev/zero of=a/1 bs=1k count=64
$ dd if=/dev/zero of=a/2 bs=1k count=64
$ dd if=/dev/zero of=a/3 bs=1k count=64
$ rsync -av a/ b/
sending incremental file list
./
1
2
3
sent 196831 bytes received 72 bytes 393806.00 bytes/sec
total size is 196608 speedup is 1.00
Then touch a file and re-sync
Code:
$ touch a/1
$ rsync -av --inplace a/ b/
sending incremental file list
1
sent 65662 bytes received 31 bytes 131386.00 bytes/sec
total size is 196608 speedup is 2.99
You can verify it re-used the inode with "ls -li", but notice it sent a whole 64K bytes. Try again with --no-whole-file
Code:
$ touch a/1
$ rsync -av --inplace --no-whole-file a/ b/
sending incremental file list
1
sent 494 bytes received 595 bytes 2178.00 bytes/sec
total size is 196608 speedup is 180.54
Now you've only sent 494 bytes. You could use strace to further verify if any of the file was written, but this shows it at least used delta-transfer.
**Test information from stackexchange @dataless
http://superuser.com/questions/57603...s-that-need-to cc by-sa 3.0