我使用的是OSX High Sierra和bash。 我试图使用基于IPv6 LLA的备份脚本(所以我总是到达服务器,没有DHCP,名称等)。
用IPv4这个工程:
rsync -e ssh /src/dir/* [email protected]:/dst/dir
在Linux / Bash上这个工作原理:
rsync -e ssh /src/dir/* user@[fe80::a:b:c:d%eth0]:/dst/dir
但在OSXterminal上,这并没有工作。
ssh: Could not resolve hostname [fe80: nodename nor servname provided, or not known rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52/rsync/io.c(453) [sender=2.6.9]
我已经尝试了很多报价组合,但没有成功。
谢谢!
问题是与rsync的OSX版本。 我不知道到底是什么问题。 它应该是一些rsync二进制/版本的function。
OSX版本:
/usr/bin/rsync --version rsync version 2.6.9 protocol version 29 ... Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, inplace, IPv6, 64-bit system inums, 64-bit internal inums
从macports安装一个版本:
/opt/local/bin/rsync --version rsync version 3.1.2 protocol version 31 ... Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace, append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags, HFS-compression
尽pipe两者都支持IPv6,但这个与OSX分发的2.6.9不能按预期工作。
用3.1.2我可以使用:
rsync -e ssh /src/dir/* user@[fe80::a:b:c:d%eth0]:/dst/dir
感谢您的帮助。