我正在尝试在64位Windows 7和64位Linux之间rsync文件。我在两台机器上安装了rsync 3.0.7(Windows上的cygwin版本)。
这是我在Windows上运行的命令。我看到它正在建立与远程机器的连接,但它在验证之后和传输文件之前就已经死了。什么可能导致这个问题?
rsync -vvvv localfile REMOTE-HOST:~/
FILE_STRUCT_LEN=16, EXTRA_LEN=4
cmd=<NULL> machine=REMOTE-HOST user=guest path=~/
cmd[0]=ssh cmd[1]=-l cmd[2]=guest cmd[3]=REMOTE-HOST cmd[4]=rsync cmd[5]=--server cmd[6]=-vvvvv.Lsf cmd[7]=. cmd[8]=~/
opening connection using: ssh -l guest REMOTE-HOST rsync --server -vvvve.Lsf. "~/"
note: iconv_open("UTF-8", "UTF-8") succeeded.
Password:
FILE_STRUCT_LEN=24, EXTRA_LEN=4
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
[Receiver] _exit_cleanup(code=12, file=io.c, line=601): entered
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [Receive
r=3.0.7]
[Receiver] _exit_cleanup(code=12, file=io.c, line=601): about to call exit(12)
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
[sender] _exit_cleanup(code=12, file=/home/lapo/packaging/rsync-3.0.7-1/src/rsyn
c-3.0.7/io.c, line=601): entered
rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packagi
ng/rsync-3.0.7-1/src/rsync-3.0.7/io.c(601) [sender=3.0.7]
[sender] _exit_cleanup(code=12, file=/home/lapo/packaging/rsync-3.0.7-1/src/rsyn
c-3.0.7/io.c, line=601): about to call exit(12)
答案 0 :(得分:4)
问题是一个冲突的git安装。 Git包含了它自己的ssh,它的路径是在cygwin路径之前,所以rsync使用的是git的ssh。解决方法是交换git / cygwin bin路径的顺序,以便rsync使用正确版本的ssh。
答案 1 :(得分:0)
我通过在调用中添加ssh的绝对路径找到了解决此错误的方法:
rsync -avzphi --chmod=ugo=rwX --checksum --delete-after -e "C:\cwRsync\ssh.exe -p 9999 -i c:\cwRsync\ssh\test_id_rsa" "/cygdrive/c/repository/blah.com/" test@xx.xx.xxx.xxx:/home/test/public_html