rsync 命令在共享主机上停止工作 - 我的怀疑是否正确?

Mat*_*cki 3 rsync

我正在使用“火箭科学”的 bash 脚本从我的本地机器快速将 Wordpress 代码部署到共享主机。一切都工作到昨天。现在我只是参与了与托管管理员的讨论,试图建议我一切都好。

这是脚本:

#!/bin/bash
printf "Running gulp\n"
gulp --production

printf "Running rsync\n"
rsync -vzrP --update ~/Code/Project/wp-content/themes/foo-theme mylogin@shared-hosting-server.com:/home/mylogin/domains/example.com/public_html/wp-content/themes/ --delete
Run Code Online (Sandbox Code Playgroud)

为了不一直提示输入密码,我将我的密钥添加到known_hosts服务器的.ssh目录中。几个月来,它完全没有问题。昨天我收到消息“身份已更改...”

Running rsync
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Please contact your system administrator.
Add correct host key in /Users/slick/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/slick/.ssh/known_hosts:7
RSA host key for shared-hosting-server.com has changed and you have requested strict checking.
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]
Run Code Online (Sandbox Code Playgroud)

我通过删除建议的行号解决了这个问题。7 从/Users/slick/.ssh/known_hosts并接受新密钥。

但这并没有解决rsync问题。

我总是得到:

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: remote command not found (code 127) at io.c(226) [Receiver=3.1.2]
Run Code Online (Sandbox Code Playgroud)

请回答我的问题或确认我的理解方式是正确的。

1)我认为问题是由托管方引起的,而在我这边一切正常吗?

2)rsync 必须存在于两端(我的本地 Mac)和共享主机上,我是否正确?根据这篇文章-rsync需要在两端。

3)我可以毫无问题地远程登录服务器ssh -l mylogin shared-hosting-server.com- 它不需要密码,所以我的known_hosts东西设置正确。在远程服务器上我输入:

rsync
Run Code Online (Sandbox Code Playgroud)

得到了

-bash: rsync: 命令未找到

which rsync
Run Code Online (Sandbox Code Playgroud)

得到了

/usr/bin/which: 中没有 rsync (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/mylogin/bin)

这意味着rsync主机上不再存在或不再可供我使用。这是问题的根源吗?

感谢您的任何解释。

eww*_*ite 6

rsync命令需要安装在传输的两侧。

您需要确保它安装在您的托管服务器上。就这些。