It is in the Window System synchronization actual combat
1. Remote Data Synchronization Tool rsync Introduction
1.1 Software Introduction
Rsync is a remote data synchronization tool that allows fast synchronization of files between multiple hosts through Lan/wan. Rsync is a tool used to replace RCP, which is currently maintained by Rsync.samba.org. Rsync uses the so-called "rsync algorithm" to synchronize files between local and remote two hosts, which transfer only a different portion of two files, rather than sending it all at a time, so it's very fast. The machine running Rsync server is also called Backup server, a rsync server can back up multiple client data at the same time, or multiple rsync servers to back up one client's data.
Rsync can be paired with rsh or SSH or even using daemon mode. Rsync Server opens a 873 service channel (port) and waits for an rsync connection. When you connect, Rsync server checks to see if passwords match, and if you check by password, you can start file transfers. When the first connection completes, the entire file is transmitted once, and the next time it transmits only two different parts of the file.
Rsync supports most Unix-like systems, both Linux, Solaris, and BSD are well tested. In addition, it also has a corresponding version under the Windows platform, the more well-known are cwrsync and Sync2nas.
The basic features of rsync are as follows:
1. Can be mirrored to save the entire directory tree and file system;
2. It is easy to maintain the original file permissions, time, soft and hard links;
3. Installation without special permission;
4. Optimized flow, high efficiency of file transfer;
5. You can use RCP, ssh and other means to transfer files, of course, can also be connected through the direct socket;
6. Support for anonymous transmission.
1.2 Core algorithms
Suppose that a similar file A and B are synchronized between two computers named Alpha and beta, where Alpha has access to file a, and beta has access to file B. and assume that the network bandwidth between the host Alpha and beta is very small. Then the rsync algorithm will be done with the following five steps:
1.β splits file B into a set of data blocks that do not overlap with a fixed size of s bytes. The last piece may be smaller than S.
2.β performs two checks on each segmented block: One is a 32-bit scrolling weak checksum and the other is a 128-bit MD4 strong checksum.
3.β These checksum results to alpha.
4.α searches for a block of data with all the size S of file A (the offset can be optional, not necessarily a multiple of s) to find a block of data that has the same weak checksum and strong parity code as a piece of file B. This work can be done quickly with the help of scrolling checksums.
5.α sends a sequence of instructions to Beta to generate a backup of file a on beta. Each instruction here is either proof that file B has a block of data without retransmission, or a block of data that must not match any of the data blocks of file B.
1.3 Command syntax
The command format for rsync can be in the following six ways:
rsync [OPTION] ... SRC DEST
rsync [OPTION] ... SRC [User@]host:dest
rsync [OPTION] ... [user@] HOST:SRC DEST
rsync [OPTION] ... [user@] HOST::SRC DEST
rsync [OPTION] ... SRC [user@]host::D EST
rsync [OPTION] ... rsync://[user@]host[:P ort]/src [DEST]
Current 1/2 page
12 Next read the full text