Realizing File synchronization with RSYNC
1. Installation (both client and server have to be installed)
Yum-y install rsync
two。 Install xinetd
Yum-y install xinetd
3. Modify xinetd configuration file
Modify / etc/xinetd.d/rsync to change disable = yes to disable = no
4. Create a rsync server profile / etc/rsyncd.conf
Vi / etc/rsyncd.conf
Uid = rootgid = rootport = 873hosts allow = 192.168.1.10hosts deny = * pid file = / var/run/rsyncd.pidlock file = / var/run/rsync.locklog file = / var/log/ rsyncd.log [DDsc] path = / usr/share/nginx/htmlcomment = rsync filesignore errorsread only = yeslist = no
5. Start RSYNC
Rsync-daemon
6. View startup status
Netstat-anpt | grep 873
7. Firewall on policy
Iptables-I INPUT-p tcp-- dport 873-j ACCEPT
Client:
Installation is the same as the server side, as long as you create an empty configuration file and start it.
Touch / etc/rsyncd.confrsync-- daemon
Start synchronization:
Synchronize the / usr/share/nginx/html directory of the server (192.168.1.100) to the local / usr/share/nginx/html on the client side
Rsync-vzrtopg-delete-progress 192.168.3.100::ddsc / usr/share/nginx/html/