标签:rsync
1.安装(客户端服务端都要安装)
yum -y install rsync
2.安装xinetd
yum -y install xinetd
3.修改xinetd配置文件
修改 /etc/xinetd.d/rsync 把 disable = yes 改为disable = no
4.创建rsync服务器配置文件/etc/rsyncd.conf
vi /etc/rsyncd.conf
uid = root gid = root port = 873 hosts allow = 192.168.1.10 hosts deny = * pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log [ddsc] path = /usr/share/nginx/html comment = rsync files ignore errors read only = yes list = no
5.启动RSYNC
rsync --daemon
6.查看启动状态
netstat -anpt |grep 873
7.防火墙开启策略
iptables -I INPUT -p tcp --dport 873 -j ACCEPT
客户端:
安装跟服务端一样,只要创建一个空的配置文件然后启动就可以
touch /etc/rsyncd.conf rsync --daemon
开始同步:
在客户端把服务端(192.168.1.100)的/usr/share/nginx/html目录同步到本地/usr/share/nginx/html
rsync -vzrtopg --delete --progress 192.168.3.100::ddsc /usr/share/nginx/html/
标签:rsync
原文地址:http://3042034.blog.51cto.com/1151449/1839620