Analysis of rsync synchronization in window system page 1/2

Source: Internet
Author: User
Tags rsync

Its synchronization practices in the window system
1. Introduction to remote data synchronization tool rsync
1.1 Software Overview

Rsync is a remote data synchronization tool that allows you to quickly synchronize files between multiple hosts through the LAN/WAN. Rsync is a tool used to replace RCP, which is currently maintained by rsync.samba.org. Rsync uses the so-called "rsyncAlgorithmTo synchronize files between the local and remote hosts. This algorithm only transfers different parts of the two files, rather than transmitting the entire file each time, so the speed is quite fast. The machine running rsync server is also called backup server. One rsync server can back up data of multiple clients at the same time, or multiple rsync servers can back up data of one client.

Rsync can be used with RSH, ssh, or even daemon mode. Rsync server opens a 873 service channel (port) and waits for the peer rsync to connect. During connection, the rsync server checks whether the Password Matches. If the password is checked, file transmission can be started. When the first connection is complete, the entire file will be transferred once, and only different parts of the two files will be transferred at the next time.

Rsync supports most UNIX-like systems, including Linux, Solaris, and BSD. In addition, it also has corresponding versions on the Windows platform, including cwrsync and sync2nas.

The basic features of rsync are as follows:

1. images can be used to save the entire directory tree and file system;

2. It is easy to maintain the permissions, time, and soft and hard links of the original file;

3. installation without special permissions;

4. optimized process, high file transmission efficiency;

5. You can use RCP, ssh, and other methods to transmit files. Of course, you can also use a direct socket connection;

6. Anonymous transmission is supported.

1.2 Core algorithms

Assume that similar files A and B are synchronized between two computers named α and beta. Alpha has access to file a and beta has access to file B. In addition, it is assumed that the network bandwidth between host α and β is very small. Then, The Rsync algorithm is completed in the following five steps:

1. Beta splits file B into a group of data blocks with a fixed size of S bytes that do not overlap. The last part may be smaller than S.

2. Beta performs two types of verification on each split data block: one is a 32-bit rolling weak verification, and the other is a 128-bit md4 strong verification.

3. Beta sends the verification results to α.

4. α searches all data blocks of file a with the size of S (the offset can be optional, not necessarily a multiple of S ), to find data blocks with the same weak verification code and strong verification code as one of file B. This work can be quickly completed using the features of rolling verification.

5. Alpha sends a string of instructions to generate a backup of file a on Beta. Each instruction here is either a proof that file B has a data block and does not need to be re-transmitted, or a data block, this data block certainly does not match any data block of file B.

1.3 command syntax

The Command Format of rsync can be as follows:

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: dest

Rsync [Option]... rsync: // [user @] host [: Port]/src [DEST]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.