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

折腾:

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

bash: rsync: 未找到命令

➜  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.

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

都正常啊。

-》才明白:

原来是远程服务器中没有安装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

Resolving Dependencies

Running transaction check

Package rsync.x86_64 0:3.0.9-18.el7 will be installed

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.

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,就可以了:

ab25f3e368ab0bcf53c1b9a5fd4cd771.png

【总结】

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

bash: rsync: 未找到命令

原因是:

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

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

办法:

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

yum -y install rsync

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值