最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Mac中已安装rsync却报错:bash: rsync: 未找到命令

Mac crifan 4030浏览 0评论

折腾:

【已解决】Mac中rsync出错:rsync: connection unexpectedly closed

期间,竟然报错,找不到rsync:

bash: rsync: 未找到命令

bash: rsync: command not found报错原因以及解决办法 – 坦GA的博客 – CSDN博客

➜  ucowsapp_h5 git:(master) ✗ rsync –version

rsync  version 2.6.9  protocol version 29

Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.

<http://rsync.samba.org/>

Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,

              inplace, IPv6, 64-bit system inums, 64-bit internal inums

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you

are welcome to redistribute it under certain conditions.  See the GNU

General Public Licence for details.

➜  ucowsapp_h5 git:(master) ✗ which rsync

/usr/bin/rsync

都正常啊。

解决bash: rsync: command not found – hao32的个人日志

-》才明白:

原来是远程服务器中没有安装rsync。。。

所以需要先去远程服务器中安装rsync,本地rsync才能使用。

[root@iZbp1d6nnllpn4f211pl59Z uapp]# which rsync

/usr/bin/which: no rsync in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

[root@iZbp1d6nnllpn4f211pl59Z uapp]# yum -y install rsync

Loaded plugins: fastestmirror

Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast

base                                                                                                                                  | 3.6 kB  00:00:00     

epel                                                                                                                                  | 4.7 kB  00:00:00     

extras                                                                                                                                | 3.4 kB  00:00:00     

mysql-connectors-community                                                                                                            | 2.5 kB  00:00:00     

mysql-tools-community                                                                                                                 | 2.5 kB  00:00:00     

mysql56-community                                                                                                                     | 2.5 kB  00:00:00     

nginx                                                                                                                                 | 2.9 kB  00:00:00     

updates                                                                                                                               | 3.4 kB  00:00:00     

(1/11): epel/x86_64/group_gz                                                                                                          | 266 kB  00:00:00     

(2/11): base/7/x86_64/group_gz                                                                                                        | 156 kB  00:00:00     

(3/11): epel/x86_64/updateinfo                                                                                                        | 878 kB  00:00:00     

(4/11): extras/7/x86_64/primary_db                                                                                                    | 166 kB  00:00:00     

(5/11): base/7/x86_64/primary_db                                                                                                      | 5.7 MB  00:00:00     

(6/11): mysql-connectors-community/x86_64/primary_db                                                                                  |  18 kB  00:00:00     

(7/11): epel/x86_64/primary_db                                                                                                        | 6.2 MB  00:00:00     

(8/11): mysql-tools-community/x86_64/primary_db                                                                                       |  38 kB  00:00:00     

(9/11): updates/7/x86_64/primary_db                                                                                                   | 6.0 MB  00:00:00     

(10/11): mysql56-community/x86_64/primary_db                                                                                          | 184 kB  00:00:00     

(11/11): nginx/x86_64/primary_db                                                                                                      |  31 kB  00:00:00     

Determining fastest mirrors

* base: mirrors.aliyuncs.com

* epel: mirrors.aliyuncs.com

* extras: mirrors.aliyuncs.com

* updates: mirrors.aliyuncs.com

Resolving Dependencies

<span style="font-size: 12px; color: rgb(51, 51, 51); font-family: Monaco;"–<> Running transaction check

<span style="font-size: 12px; color: rgb(51, 51, 51); font-family: Monaco;"–<-> Package rsync.x86_64 0:3.0.9-18.el7 will be installed

<span style="font-size: 12px; color: rgb(51, 51, 51); font-family: Monaco;"–<> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================

Package                            Arch                                Version                                      Repository                         Size

=============================================================================================================================================================

Installing:

rsync                              x86_64                              3.0.9-18.el7                                 base                              360 k

Transaction Summary

=============================================================================================================================================================

Install  1 Package

Total download size: 360 k

Installed size: 732 k

Downloading packages:

rsync-3.0.9-18.el7.x86_64.rpm                                                                                                         | 360 kB  00:00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : rsync-3.0.9-18.el7.x86_64                                                                                                                 1/1

  Verifying  : rsync-3.0.9-18.el7.x86_64                                                                                                                 1/1

Installed:

  rsync.x86_64 0:3.0.9-18.el7                                                                                                                                

Complete!

[root@iZbp1d6nnllpn4f211pl59Z uapp]# which rsync         

/usr/bin/rsync

[root@iZbp1d6nnllpn4f211pl59Z uapp]# rsync –version

rsync  version 3.0.9  protocol version 30

Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.

Web site: http://rsync.samba.org/

Capabilities:

    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,

    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,

    append, ACLs, xattrs, iconv, symtimes

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you

are welcome to redistribute it under certain conditions.  See the GNU

General Public Licence for details.

然后本地再去试试rsync,就可以了:

【总结】

本地的Mac中,已经安装了rsync了,但是终端中执行rsync报错:

bash: rsync: 未找到命令

原因是:

使用rsync的前提是:本地电脑和远程服务器都安装了rsync才可以。

而此处远程服务器中没有安装rsync,所以报错。

办法:

给远程服务器,此处是CentOS,中安装rsync即可:

yum -y install rsync

转载请注明:在路上 » 【已解决】Mac中已安装rsync却报错:bash: rsync: 未找到命令

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.190 seconds, using 22.06MB memory