我正在尝试使用 rsync 和 makefile 将 mac 上的本地文件发布到我的服务器。
运行 make 命令时出现以下错误:
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
奇怪的是,如果我直接在 shell 中输入 rsync 命令,它就会起作用。
下面是 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)
任何人都可以理解这一点吗?
谢谢,
卢茨
最佳答案
我最近在 Ubuntu 18.04 docker 镜像上遇到了同样的错误。按照建议安装 openssh-client 软件包 here为我解决了问题。sudo apt install -y openssh-client
关于Makefile 和 rsync 错误 : Failed to exec ssh: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19260675/