我很困惑为什么 rsync 需要 --rsync-path 标志,即使远程 rsync 在路径中。
考虑:
$ rsync -avze 'ssh -p 22' --delete public/ pmatos@domain.com:~/public_html
bash: /usr/local/bin/rsync: No such file or directory
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(601) [sender=3.0.7]
Run Code Online (Sandbox Code Playgroud)
然后我尝试添加 --rsync-path
$ rsync -avze 'ssh -p 22' --rsync-path=/usr/bin/rsync --delete public/ pmatos@domain.com:~/public_html
sending incremental file list
...
Run Code Online (Sandbox Code Playgroud)
因此,第一个 rsync 没有成功,因为它正在 /usr/local/bin 中搜索 rsync,但是一旦我使用 --rsync-path 传递了 rsync 的明显路径,它就会起作用。
为什么是这样?(此命令行是 octopress 中 rake deploy 发出的命令行)
我的记忆现在对此很模糊,但发生这种情况的原因是我在某个时候在 rsync 上使用了 GNU stow 并创建了一些混淆了rsync
位置的符号链接。这是经过一番折腾之后才解决的。现在我的头发淡了很多,但另一方面我也有工作rsync
。如果你问我的话,那一定是一场胜利。
归档时间: |
|
查看次数: |
20870 次 |
最近记录: |