使用以下命令从远程服务器执行rsync pull时:
/usr/bin/rsync -av -e ssh --delete --chmod=a+rwx,g+rwx,o-wx --dry-run username@server:/remote/path/ /home/dir/local/path
我收到以下错误:
receiving file list ... Invalid flist flag: 1004 rsync error: protocol incompatibility (code 2) at flist.c(2354) [Receiver=3.0.7]
当从远程到本地进行反向(即PUSH)时,我得到以下结果:
building file list ... Invalid flist flag: 1004 rsync error: protocol incompatibility (code 2) at flist.c(2354) [Receiver=3.0.7] rsync: connection unexpectedly closed (8 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(468) [sender=2.6.8]
我已经尝试逐个删除参数,它似乎与-a标志有关
环境
# local machine Linux lBox 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux # rsync version rsync version 3.0.7 protocol version 30 # remote machine FreeBSD rBox 6.4-STABLE FreeBSD 6.4-STABLE #0: Mon Feb 22 01:05:13 EST 2010 UNIX-BSD rsync version 2.6.8 protocol version 29
这可以轻松解决吗?
解决方法
FreeBSD盒子有一个有六年历史的rsync版本,它使用较旧的协议版本.您可以通过在rsync命令中添加–protocol = 29来强制新版本的rsync使用旧协议.