disable = no <---------- change to yes
rsyncd.conf rsyncd.motd rsyncd.secrets
vi rsyncd.conf
motd file = /etc/rsyncd.motd #欢迎文件
read only = no
list = yes
uid = root #可以创建了备份用户,也可用root,默认是nobody
gid = root
#hosts allow = 192.168.0.61
#hosts deny =192.168.128.0/24
max connections = 2 #设置连接数为2, 默认连接数不限制
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
[test] #模块:rsync的客户端
#comment = nagios's directory from 192.168.0.61
secrets file =/etc/rsyncd.secrets #密码存放文件
auth users = test #连接帐号,和系统帐号没关系,服务器必须上存在此账号
read only = no
[root@localhost test]# vi /etc/rsyncd.motd
Welcome to use the test rsync services!
[root@localhost test]#vi /etc/rsyncd.secrets #密码文件权限为600,此步必须设置
test:test
6.运行rsync
rsync --daemon /etc/rsyncd.conf
1.a)安装rsync包 ----yum install rsync
b)创建密码文件
[root@localhost ~]#vi /etc/rsyncd.secrets
test#客户端只需密码无须用户
c)chmod 600 /etc/rsyncd.secrets ----修改权限
如果没有这步会报如下:
password file must not be other-accessible
continuing without password file
Password:
3.实现定时同步,假设凌晨2两同步
vim crond.rsync
00 2 * * * rsync -vzrtopg --progress --delete --password-file=/etc/rsyncd.secrets test@192.168.0.61::test /var/www/example_com/dl01/pub
crontab -e编辑现在有crontab
crontab -l
















