1)软件是否存在
[root@backup ~]# rpm -qa |grep rsync
rsync-3.0.6-12.el6.x86_64
需求:查询到某个命令非常有用。但是不知道属于哪个软件包
yum provides rysnc
provides Find what package provides the given value
2)进行软件服务配置
[root@backup ~]# vim /etc/rsyncd.conf
uid = rsync
gid = rsync
use chroot = no
max connections = 200
timeout = 300
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = false
list = false
hosts allow = 172.16.1.0/24
auth users = rsync_backup
secrets file = /etc/rsync.password
[backup]
comment = "backup dir by oldboy"
path = /backup
[nfsbackup]
comment = "nfsbackup dir by hzs"
path = /nfsbackup
3)创建rsync管理用户
[root@backup ~]# useradd -s /sbin/nologin -M rsync
4)创建数据备份储存目录,目录修改属主
[root@backup ~]# mkdir /nfsbackup/
[root@backup ~]# chown -R rsync.rsync /nfsbackup/
5)创建认证用户密码文件并进行授权600
echo "rsync_backup:oldboy123" >>/etc/rsync.password
chmod 600 /etc/rsync.password
6)启动rsync服务
rsync --daemon
至此服务端配置完成
[root@backup ~]# ps -ef |grep rsync
root 2076 1 0 17:05 ? 00:00:00 rsync --daemon
root 2163 1817 0 17:38 pts/1 00:00:00 grep --color=auto rsync
2.1.2 rsync客户端配置1)软件是否存在
[root@backup ~]# rpm -qa |grep rsync
rsync-3.0.6-12.el6.x86_64
2)创建安全认证文件,并进行修改权限600
echo "oldboy123" >>/etc/rsync.password
chmod 600 /etc/rsync.password
3) 测试数据传输
[root@nfs01 sersync]# rsync -avz /data rsync_backup@172.16.1.41::nfsbackup --password-file=/etc/rsync.password
sending incremental file list
data/
data/.hzs
data/.tar.gz
data/.txt
2.2 第二个里程碑:部署inotify服务首先先确认是否有epel源用来安装inotify-tools软件
[root@nfs01 ~]# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status