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
hosts deny = 0.0.0.0/32
auth users = rsync_backup
secrets file = /etc/rsync.password
[backup]
comment = "backup dir by oldboy"
path = /backup
read only = true
[nfs]
comment = "backup dir by oldboy"
path = /nfs
第三个里程:创建备份目录管理用户
useradd rsync -M -s /sbin/nologin
第四个里程:创建备份目录
mkdir /backup
chown -R rsync.rsync /backup
第五个里程:创建认证文件
echo "rsync_backup:oldboy123" >>/etc/rsync.password
chmod 600 /etc/rsync.password
第六个里程:启动rsync服务
rsync --daemon
2)客户端部署流程
第一个里程:确认软件是否安装
[root@backup ~]# rpm -qa rsync
rsync-3.0.6-12.el6.x86_64
第二个里程:创建认证密码文件
echo "oldboy123" >>/etc/rsync.password
chmod 600 /etc/rsync.password
第三个里程:进行数据备份测试
[root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.password
sending incremental file list
hosts
sent 189 bytes received 27 bytes 432.00 bytes/sec
total size is 352 speedup is 1.63
原文:http://blog.51cto.com/tangyong/2120922