CentOS 6.0 Install the Rsync Remote Data Synchronization tool

Source: Internet
Author: User
Tags centos rsync

Rsync (synchronize) is a remote data synchronization tool that allows you to quickly synchronize files between multiple hosts by Lan/wan. Rsync uses the so-called "rsync algorithm" to synchronize files between local and remote two hosts, and this algorithm transmits only a different portion of two files, rather than sending it all at a time, so it's very fast.
Rsync was originally used as a tool to replace RCP and is currently maintained by rsync.samba.org, so the format of rsync.conf files is similar to Samba's main configuration file. Rsync can be used in rsh or SSH or in daemon mode, and Rsync server will open a 873 port to wait for the client to connect when running daemon. 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 then only incremental backups are made.

Rsync supports most Unix-like systems, both Linux, Solaris, and BSD are well tested. In addition, it is under the Windows platform

There are also corresponding versions, such as Cwrsync and Sync2nas tools.

Install rsync3.0.9 version
http://rsync.samba.org/ftp/rsync/Download Address

1, download binary source rsync-3.0.9.tar.gz and patch server and client all use this program.
2, decompression unpacking # tar zxvf rsync-3.0.9.tar.gz and patches
3. Configure # CD rsync-3.0.9

4 configuration./configure--prefix=/usr/local/rsync

5. Compile and install # Make&&make install
6, the above steps in the client and server side of the implementation.

7. configuration file rsyncd.conf
Vi/etc/rsyncd.conf

#全局参数设置: This part of the set parameters affect the entire program's operation
UID = root #rsync运行时的用户ID (settings for user ID and user group ID are guaranteed to have read to sync files and text

Permission to the folder)
GID = root #rsync运行时的用户组ID
Max connections = 0 #同时最大的连接数, 0 is unrestricted
PID file =/var/log/rsync/rsyncd.pid #记录rsync运行时的进程ID
Lock file =/var/log/rsync/rsync.lock #以文件的方式锁的方式 to ensure that rsync runs once
Log file =/var/log/rsync/rsyncd.log #rsync日志信息包括启动信息同步信息等
Port = 873 #可以指定rsync运行时使用的端口, using 873 by default (without specifying the use of

Default)
     use chroot = no                       &NBS p; #不使用chroot
      #同步模块配置
     [data]             &NBS P #要同步的文件夹的别名, accounts directly written here, just a name convenient memory, customer

End to use the same
Path =/data #指定要同步的具体文件夹, where the folder is actually synchronized
Comment = Backup data #备注信息, mainly some descriptive information to help memory, etc.
Ignore Errors #忽略一些无关的错误信息
Read Only = False #是否设置以只读的方式运行, this tool supports external synchronization and postback yo
List = False #是否允许客户端查看文件列表
Hosts allow = 192.168.40.42 #允许同步的客户机IP, multiple with "," separated
Auth users = Test #同步认证时使用的用户名, can be specified arbitrarily, but must exist in the password file for the next item
Secrets file =/root/rsync.passwd #密码认证文件, this file contains the user name and password corresponding to the client authentication, the configuration file name can be arbitrary

Related Article

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.