Linux rsync configuration and installation, yum installation 2. Check whether xinetd is installed, not installed, and yum installation 3. open the port required by rsync in firewall, modify/etc/sysconfig/iptablesShell code-a input-m state -- state NEW-m tcp-p tcp -- dport 873-j ACCEPT 4 and add the configuration file/etc/rsyncd. confShell code touch/etc/rsyncd. conf chmod 600/etc/rsyncd. conf 5. Edit rsyncd. confConf code uid = nobody gid = nobody user chroot = no max connections = 200 timeout = 600 pid file =/var/run/rsyncd. pid lock file = /Var/run/rsyncd. lock motd file =/etc/rsyncd. motd log file =/var/log/rsyncd. log [data] path =/data ignore errors read only = yes list = no hosts allow = 10.8.83.0/255.255.255.0 10.8.100.0/255.255.255.0 auth users = rsync secrets file =/etc/rsyncd. pwd 6. Create the welcome file/etc/rsyncd. motdShell code touch/etc/rsyncd. motd chmod 600/etc/rsyncd. motd 7. Create a password file/etc/rsyncd. pwdShell code touch/etc/rsyncd. pwd chmod4 600 /Etc/rsyncd. pwd 8. Edit the password file/etc/rsyncd. pwdPwd code rsync: rsync 9. Edit the Startup file/etc/xinetd. change disable in d/rsync to noProperties Code service rsync {disable = no socket_type = stream wait = no user = root server =/usr/bin/rsync server_args = -- daemon log_on_failure + = USERID} 10. Configure chkconfig rsync on 11 as the Shell code starts with the system, and start the Shell code service xinetd restart/etc/rc. d/init. d/xinetd reload 12. test whether the Shell code netstat-a has been started properly. | grep Rsync 13, directly check the file Shell code rsync -- list-only rsync@10.8.100.100: data Client use method 1, installation, if not as a server, yum installation can be 2, if you do not want to enter the password, generate a password file, which can be any Shell code touch/etc/rsyncd. pwd chmod 600/etc/rsyncd. pwd 3, use: Shell code # Pull Remote data Back rsync-vzrtopg -- delete rsync@10.8.100.100: data/data -- password-file =/etc/rsyncd. pwd back up local data to remote rsync Server rsync-vzrtopg -- delete/data rsync@10.8.100.100: data -- password-file =/etc/rsyncd. pwd # -- de Lete indicates that the folder is completely consistent and will be deleted. 4. Use cron for scheduled operations (1) generate the script/usr/backup. shJava code touch/usr/backup. sh chmod/usr/backup. sh (2) Add Sh Code #! /Bin/sh rsync-vzrtopg -- delete rsync@10.8.100.100: data/data -- password-file =/etc/rsyncd. pwd (3) Add to cronShell code crontab-e # Add ***** sh/usr/backup. sh/* indicates that/usr/backup is executed every minute. sh file (4) Restart cronJava code/etc/init. d/crond restart