The fundamentals of Rsync
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.
The advantages of rsync
① can be mirrored to save the entire directory tree and file system;
② can be easy to maintain the original file permissions, time, soft and hard links;
③ without special permission can be installed;
④ optimized process, high file transfer efficiency;
⑤ can use rsh, ssh and other means to transfer files, of course, can also be connected through the direct socket;
⑥ Support for anonymous transmissions
Rsync Installation
Rsync Server 192.168.1.100
Rsync clinet 192.168.1.200
Yum install-y rsync adopts yum installation rsync
Getenforce See if the SELinux is turned on, if the value 1 indicates
Setenforce 0 shuts down SELinux and does not need to reboot the server
Restart Service:/etc/init.d/xinetd restart
Use Ps-ef |grep rsync to see if the Rsync service is open
Service-side configuration:
Rsync default configuration file does not exist, requires system administrator to create a new rsync configuration file
[Root@nagios SH] #vim/etc/rsyncd.conf
UID = Users who are backed up by www
GID = Groups that are backed up by www
User Chroot = no set to Yes must be detected with the root user, path specified directory
Max connections = 200 Maximum number of connections
Timeout = 600 Allow client connection time
PID file = location where/var/run/rsyncd.pid pid files are stored
Lock file = location where/var/run/rsyncd.lock lock files are stored
Log file = location where/var/log/rsyncd.log log files are stored
[WWW] Certified module name
path=/data/www/specify directories to participate in synchronization
Ignore errors can ignore some irrelevant IO errors
Read Only = no allows readable writable
List = no does not allow column listings
Hosts allow = 192.168.1.200 Specifies the IP address of the client synchronization
Hosts deny = *
Auth users = rsync designated authenticated user
Secrets file =/etc/rsyncd.password Certified password files
Chomd-r 777/data
Echo rsync:123456 >/etc/rsyncd.password
chmod 600/etc/rsyncd.password
Be sure to modify the/etc/xinetd.d/rsync
Disable=no