open encyclopedia * Article Search: * *
*
*

Rsync

From open-encyclopedia.com - the free encyclopedia.

rsync is a utility which synchronizes files and directories between two locations while minimizing data transfer.

Algorithm

The rsync utility uses an algorithm (invented by Australian computer programmer Andrew Tridgell) for efficiently transmitting a file across a communications link when the receiving computer already has a different version of the same file.

The recipient splits its copy of the file into fixed-size non-overlapping chunks, say of size S, and computes two checksums for each chunk: the MD4 hash, and a weaker 'rolling checksum'. It sends these checksums to the sender.

The sender computes the rolling checksum for every chunk of size S in its own version of the file, even overlapping chunks. It can do this efficiently because of a special property of the rolling checksum: if the rolling checksum of bytes n through n+S-1 is R, it is easy to compute the rolling checksum of bytes n+1 through n+S from R, byte n, and byte n+S; without having to examine the intervening bytes.

The sender then compares its rolling checksums with the set sent by the recipient to determine if any matches exist. If they do, it verifies the match by computing the MD4 checksum for the matching block and by comparing it with the MD4 checksum sent by the recipient.

The sender then sends the recipient those parts of its file that didn't match any of the recipient's blocks, along with assembly instructions on how to merge these blocks into the recipient's version to create a file identical to the sender's copy.

If the sender's and recipient's versions of the file have many sections in common, the utility needs to transfer relatively little data to synchronize the two files.

External links

pl:rsync

Contribute Found an omission? You can freely contribute to this Wikipedia article. Edit Article
Copyright © 2003-2004 Zeeshan Muhammad. All rights reserved. Legal notices. Part of the New Frontier Information Network.