1、配置rsync源服务器
rsync是一个开源的快速备份工具,可以在不同主机之间镜像同步整个目录树,支持增量备份,保持链接和权限,且采用优化的同步算法。
[root@localhost ~]# rpm -q rsync
rsync-3.1.2-4.el7.x86_64
在远程同步任务中,负责发起rsync同步操作的客户机称为发前端,而负责响应来自客户机的rsync同步操作的服务器称为同步源。在同步过程中,同步与负责提供文档的原始位置,发前端应对该位置具有读取权限。
配置rsync同步源需要建立配置文件rsyncd.conf,创建备份账号,然后将rsync程序以守护进程("--daemon"选项)方式运行。
1)建立/etc/rsyncd.conf配置文件
配置文件rsyncd.conf位于/etc目录下。
[root@localhost ~]# cat /etc/rsyncd.conf
uid = nobody
gid = nobody
use chroot = yes
address = 192.168.136.24
port 873
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
[wwwroot]
path = /var/www/html
comment = Document Root of www.bdqn.com
read only = yes
dont compress = *.gz *.bz2 *.taz *.zip *.rar
auth users = backuper
secrets file = /etc/rsyncd_users.db
2)为备份账户创建数据文件
创建账号数据文件,添加一行用户记录,以冒号分隔,用户名称为"backuper",密码为&#