我无法弄清楚我的RSync发生了什么。我在RHEL5上运行RSync,ip = xx.xx.xx.97。它从RHEL5获取文件,ip = xx.xx.xx.96。
这是我在xx.97(请求文件的那个)上显示的日志(我在RSync命令行中指定的):
(local time)
2015/08/30 13:40:01 [17353] @ERROR: auth failed on module tomcat_backup
2015/08/30 13:40:01 [17353] rsync error: error starting client-server protocol (code 5) at main.c(1530) [receiver=3.0.6]
以下是xx.96(提供文件的日志)上显示的日志(在rsyncd.conf文件中指定):
(UTC time)
2015/08/30 07:40:01 [8836] name lookup failed for xx.xx.xx.97: Name or service not known
2015/08/30 07:40:01 [8836] connect from UNKNOWN (xx.xx.xx.97)
2015/08/30 07:40:01 [8836] auth failed on module tomcat_backup from unknown (xx.xx.xx.97): password mismatch
这是从xx.xx.xx.97(请求者)调用的实际rsync.sh命令:
export RSYNC_PASSWORD=rsyncclient
rsync -havz --log-file=/usr/local/bin/RSync/test.log rsync://rsyncclient@xx.xx.xx.96/tomcat_backup/ProcessSniffer/ /usr/local/bin/ProcessSniffer
这是xx.xx.xx.97上的rsyncd.conf:
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
[files]
name = tomcat_backup
path = /usr/local/bin/
comment = The copy/backup of tomcat from .96
uid = tomcat
gid = tomcat
read only = no
list = yes
auth users = rsyncclient
secrets file = /etc/rsyncd.secrets
hosts allow = xx.xx.xx.96/255.255.255.0
这是xx.xx.xx.97上的rsyncd.secrets:
files:files
这是xx.xx.xx.96(文件供应商)上的rsyncd.conf:
注意:还有一个'cwrsync'(Windows版本的rsync)成功调用文件(xx.xx.xx.100)
注意:是的,xx.96可能会从xx.97请求文件。但是,这实际上并没有发生。
它是从init.d机制中注释掉的。
lock file = /var/run/rsync.lock
log file = /var/log/rsync.log
pid file = /var/run/rsync.pid
strict modes = false
[files]
name = tomcat_backup
path = /usr/local/bin
comment = The copy/backup of tomcat from xx.97
uid = tomcat
gid = tomcat
read only = no
list = yes
auth users = rsyncclient
secrets file = /etc/rsyncd.secrets
hosts allow = xx.xx.xx.97/255.255.255.0, xx.xx.xx.100/255.255.255.0
这是xx.xx.xx.97上的rsyncd.secrets:
files:files
答案 0 :(得分:0)
这是别的东西。我有一个调用rsync命令的脚本,这导致了问题。实际的rsync命令行没问题。 道歉。
答案 1 :(得分:0)
这是我遇到此错误时遇到的问题。我的第一个想法是检查rsync服务器日志。并且它不在rsync.conf
中配置的位置。然后,我检查了systemctl status rsyncd
rsyncd[23391]: auth failed on module signaling from unknown (172.28.15.10): missing secret for user "rsync_backup"
rsyncd[23394]: Badly formed boolean in configuration file: "no # rsync daemon before transmission, change to the root directory and limited within.".
rsyncd[23394]: params.c:Parameter() - Ignoring badly formed line in configuration file: ignore errors # ignore some io error informations.
rsyncd[23394]: Badly formed boolean in configuration file: "false # if true, cannot upload file to this server.".
rsyncd[23394]: Badly formed boolean in configuration file: "false # if true, cannot download file from this server.".
rsyncd[23394]: Badly formed boolean in configuration file: "false # if true, can only list files here.".
结合日志配置不起作用的事实。似乎rsync.conf中每行配置之后的注释使配置无效。因此,我删除了这些# ...
并重新启动rsyncd。