1.rsync安装
yum -y install rsync
2.配置/etc/rsync.conf #没有可自行创建
uid = nobody
gid = nobody
use chroot = no
max connections = 500
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
log file = /var/run/rsyncd.log
exclude = lost+found/
transfer logging = yes
timeout = 900
ignore nonreadable = yes
dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
[rsync] #模块名字,随意写
path = /root/backuptest/
comment = ftp export area
ignore errors
read only = no
write only = no
hosts allow = *
list = false
uid = root
gid = root
auth users = backup
secrets file = /etc/rsyncd.passwd
3.创建/etc/rsyncd.passwd
echo "backup:123" > /etc/rsyncd.passwd #账号:密码,虚拟账号,无需创建实际账号
chmod 600 /etc/rsyncd.passwd
4.启动守护进程
/usr/bin/rsync --daemon --config=/etc/rsyncd.conf
5.设置开机启动
echo "/usr/bin/rsync --daemon --config=/etc/rsyncd.conf" >> /etc/rc.local
通告: Sersync+Rsync实时复制项目实践 – 瓜丢夏
通告: Inotify+Rsync实时复制项目实践 – 瓜丢夏
通告: Rsync+Cwrsync实现linux与windows文件同步 – 瓜丢夏