Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As to my best knowledge the algorithm within the rsync tool will slice the file and compute for each slice a hash. So I assume that there are files where the hash algo will rebuild a file without actually transferring less data. I suppose a file with only zeros will be a good candidate, right?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The rsync algorithm is more sophisticated than that. Hashes for file slices are computed for the remote file and transmitted to the local rsync. The local rsync uses these hashes to find matching file sections in the local file anywhere they occur. These matching sections are not transmitted; tokens telling the remote rsync how to reproduce these section are sent instead, which is how rsync avoids transmitting the whole file.

So, optimal files for rsync are those with vast swathes of data in common, perhaps shifted by insertions and deletions, e.g. the sorts of files produced by typical human editing activities. This is unsurprising since, as rsync author Andrew Tridgell wrote in his PhD thesis, he began considering the rsync algorithm while waiting impatiently for program source files to be updated over a modem link.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.