一、
在客户端执行rsync的时候出现 command not found
command not found
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [receiver=3.0.6]
解决办法:
服务端安装yum install -y rsync,这个命令实际已经解决了,然后又检查了有没有openssh-client
两台机器检查# rpm -q openssh-client,如没有安装即可解决。
二、
问题:@ERROR: chroot failed
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]
客户机输入下面的命令返回的错误,
# rsync -avL laowang@192.168.32.128::test/nake/ /tmp/test1
原因: (在网上搜的)
服务器端的目录不存在或无权限,创建目录并修正权限可解决问题。
原因在于没有创建指定的path目录,指定目录是path=/root/rsync,意思是在传输文件的时候,之传输这里面的文件。
返回服务端服务端指定的路径是 path=/root/rsync
#mkdir -p /root/rsync 【在这里面创建nake目录或文件,客户端才可以传输】
以上修改已经成功建立连接,为了验证,把path修改为/tmp,并成功传输tmp下的mysql.sql
# rsync -avL laowang@192.168.32.128::test/mysql.sock /tmp/
三、以上两个是复习的时候出现的,下面这个是第一次操作时出现的问题
@ERROR: auth failed on module test
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
其实这里是没有完全里面命令格式每一段的意思。
格式说明 rsync -avL test@192.168.247.129::test/test1 /tmp/test5/
第一个test是配置文件中的auth users,第二个test是配置文件中定义的模块名[test]
或者改成不一样的试试
[test]
path=/tmp
auth users=laowang
这个配置文件,test要在后面,laowang要在前面,然后传输的文件要在/tmp下面才可以传输。注意密码文件也要修改。
rsync -avL laowang@192.168.247.129::test/test1 /tmp/test5/ 【可以连接成功,前台是tmp下有目录】
rsync -avL laowang@192.168.247.129::test/etc/rsync.conf /tmp/test5/
这个就不成功,因为指定的目录和文件并不存在,会继续报错。
编辑回复