1.server端 : rsyncd.conf
uid = root
gid = root
use chroot = no
read only = no
hosts allow=10.0.2.0/255.255.255.0
max connections = 5
pid file = /var/run/rsyncd.pid
secrets file = /etc/rsyncd/rsyncd.secrets
motd file = /etc/rsyncd/rsyncd.motd
log file = /var/log/rsync.log
transfer logging = yes
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300
[winson]
path = /home/winson/rsync
comment = test
2.安装 xinetd ,开启用xinetd 管理rsync : /etc/xinetd.d/rsync 修改 disable = no ; 重启 xinetd
3.客户端:
查看list :rsync -avzP 10.0.2.38:: ; rsync -avzP 10.0.2.38::winson
同步: rsync -avzP 10.0.2.38::winson /home/winson/rsync ; rsync -avzP
--delete 10.0.2.38::winson /home/winson/rsync 删除多余的文件
上传到服务器: rsync /home/winson/rsync /xxx -avzP --delete 10.0.2.38::winson 只需要把路径对调