一、安装rsync
安装rsync,我们可以分为两种方式:源码方式安装和RPM方式安装。注意:rsync软件无论是服务器端还是客户端都是同一个软件包。
1、源码方式安装
# 源码方式安装rsync,需要到其官网下载对应的安装包。rsync官网:rsync.samba.org
1)、下载
wget https://download.samba.org/pub/rsync/src/rsync-3.2.3.tar.gz
2)、解压并安装
tar -xvf rsync-3.2.3.tar.gz
3)、编译安装
# 源码安装rsync时,其编译时所需要的gcc库文件尽量提前安装完毕
# 默认安装到/usr/local/目录下
./configure
make &&make install
4)、设置开机启动
echo “/usr/local/bin/rsync --daemon -config=/etc/rsyncd.conf” >>/etc/profile
2、 yum方式安装
1)#yum -y install rsync
2)#cat /etc/rsyncd.conf
uid = rsync #运行进程的用户
gid = rsync #运行进程的用户组
port = 873 #监听端口
fake super = yes &