2013-10-09 78 views
1

我试图使用rsync和makefile将mac上的本地文件发布到我的服务器。 当运行make命令我碰到下面的错误:Makefile和rsync错误:无法执行ssh:没有这样的文件或目录

rsync: Failed to exec ssh: No such file or directory (2) 
rsync error: error in IPC code (code 14) at /SourceCache/rsync/rsync-42/rsync/pipe.c(86) [sender=2.6.9] 
rsync: connection unexpectedly closed (0 bytes received so far) [sender] 
rsync error: error in IPC code (code 14) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9] 
make: *** [deploy] Error 14 

奇怪的是,rsync命令会,如果我直接在shell中输入它的工作。

这里的Makefile中有趣的部分:

USER = admin 
SERVER = 92.243.xx.xx 
PATH = d_ghost1/www/sub.domain.de/htdocs/ 

deploy: 
    /usr/bin/rsync -avz \ 
    --exclude '.git*' \ 
    --exclude '.DS*' \ 
    --exclude '*.log' \ 
    --exclude 'config.ini\*' \ 
    --exclude 'backend/config.ini\*' \ 
    ./{assets,backend,frontend,templates,waffle} $(USER)@$(SERVER):$(PATH) 

任何人都可以理解这一点? 谢谢, 卢茨

+0

我不知道rsynch,但它有可能在某些shell而不是其他的shell中起作用?有几件事情你可以缩小问题的范围 - 我会从一个规则开始,这个规则是'哪个ssh'。 – Beta

+0

我这样做了,make所使用的shell知道/ usr/bin/ssh中的ssh – user2373001

+0

好的,接下来我会尝试尽可能简化makefile,同时仍然重现错误。此外,谷歌表示rsync有时无法找到ssh,因此您可以尝试在rsync/bin /中使用符号链接,或使用-e/usr/bin/ssh。 – Beta

回答

0

如果重命名局部变量PATH喜欢的东西REMPATH,你会不会与系统的PATH变量干扰(指到哪里查找可执行文件),并希望所有的应该是你所期望的......

相关问题