问题描述
我正在尝试进行rsync网络复制.我正在使用自制软件的最新版本的rsync.源终端和目标终端都显示:
$其中rsync/usr/local/bin/rsync$ rsync-版本rsync版本3.1.3协议版本31
我可以成功地从src对文件进行 scp
到目的地的操作:
scp/Users/me/file.txt [email protected]:/Users/me/
但是,如果我尝试使用rsync进行同样的操作:
rsync -avihX --progress --stats/Users/me/file.txt [email protected]:/Users/me/
我收到以下错误:
rsync:在远程计算机上:-vlogDtpXre.iLsfxC:未知选项rsync错误:/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.1/rsync/main.c(1337)中的语法或用法错误(代码1)[server = 2.6.9]rsync:连接意外关闭(到目前为止已收到0个字节)[发送方]rsync错误:io.c(226)处rsync协议数据流(代码12)中的错误[sender = 3.1.3]
我在这里看到过其他帖子,大多数人说它要么是错误的文件路径,要么是目标终端上的 rsync 版本不匹配,我已经排除了这两种情况.
消息的"[server = 2.6.9]"部分暗示您正在出现版本不匹配的情况.我不确定确切如何将 rsync
命令发送到远程端,但是它并不总是使用与您交互获得的相同的 PATH
(以及版本).尝试添加-rsync-path =/usr/local/bin/rsync
(或远程计算机上rsync v3.1.3的适当路径)以强制其使用正确的版本./p>
I'm trying to do a rsync network copy. I'm using homebrew's latest version of rsync. Both source and dest terminals show:
$ which rsync
/usr/local/bin/rsync
$ rsync --version
rsync version 3.1.3 protocol version 31
I can successfully scp
a file from the src to dest with:
scp /Users/me/file.txt [email protected]:/Users/me/
However if I try the same with rsync:
rsync -avihX --progress --stats /Users/me/file.txt [email protected]:/Users/me/
I get the following error:
rsync: on remote machine: -vlogDtpXre.iLsfxC: unknown option
rsync error: syntax or usage error (code 1) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.1/rsync/main.c(1337) [server=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.3]
I've seen other post here and most say it's either a bad file path or non-matching rsync versions on destination terminal, both of which I've rules out.
That "[server=2.6.9]" part of the message implies you are getting a version mismatch. I'm not sure exactly how it sends the rsync
command to the remote end, but it doesn't always use the same PATH
(and hence version) that you get interactively. Try adding --rsync-path=/usr/local/bin/rsync
(or whatever the appropriate path for rsync v3.1.3 is on the remote computer) to force it to use the right version.
这篇关于在Mac OS上,io.c(226)[sender = 3.1.3]出现rsync错误(代码12)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!