rsyncd.motd #这个可以不用新建
motd file = /etc/rsyncd.motd #欢迎文件
read only = no #可以在这里配置no,但是在同步项目中配置yes,这里的这个是全局配置项
list = yes
uid = root
gid = root
hosts allow = 192.168.128.133 192.168.0.0/16
hosts deny =192.168.128.0/24
max connections = 2
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
/usr/local/rsync/bin/rsync --daemon /etc/rsyncd.conf
rsync -vzrtopg --progress --delete --password-file=/etc/rsyncd.client
*/10 * * * * rsync -vzrtopg --progress --delete --password-file=/etc/rsyncd.client user@192.168.128.130::web /root/date
(svn co https://192.168.1.100/game/trunk/Release/web /var/svn/web)
rsync -vzrtopgl --exclude \.svn --exclude WEB-INF/classes/jdbc.properties --exclude Thumbs.db --progress --password-file=/etc/rsyncd.pwd /var/svn/web/* [email protected]::web
错误一:
@ERROR: auth failed on module xxxxx
rsync: connection unexpectedly closed (90 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)
解决:这是因为密码设置错了,无法登入成功,检查一下rsync.pwd,看客服是否匹配。还有服务器端没启动rsync 服务也会出现这种情况。
错误二:
password file must not be other-accessible
continuing without password file
Password:
解决:这是因为rsyncd.pwd rsyncd.sec的权限不对,应该设置为600。如:chmod 600 rsyncd.pwd
错误三:
@ERROR: chroot failed
rsync: connection unexpectedly closed (75 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)
解决:这是因为你在 rsync.conf 中设置的 path 路径不存在,要新建目录才能开启同步。
错误四:
rsync: failed to connect to 218.107.243.2: No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
解决:对方没开机、防火墙阻挡、通过的网络上有防火墙阻挡,都有可能。关闭防火墙,其实就是把tcp udp 的873端口打开。