基于daemon模式的rsync同步服务

1.配置rsync服务器(文件提供者)

#yum install rsync -y 

#vim /etc/xinetd.d/rsync

     disable = no

#/etc/init.d/xinetd restart

 #>touch /etc/rsyncd.conf

 #>touch /etc/rsyncd.secrets

 #>touch /etc/rsyncd.motd

#>vim /etc/rsyncd.conf

pid file = /var/run/rsyncd.pid

port = 873

address = 10.24.209.14

uid = nobody

gid = nobody

use chroot = no


#limit access to private LANs

hosts allow= 10.24.182.238 

hosts deny=*
max connections = 5
#欢迎信息

motd file = /etc/rsyncd.motd

log format = %t %a %m %f %b
syslog facility = local3

timeout = 300


#模块
[zd]
path = /export/insurance/reconciliation/download/10013/
list=yes
ignore errors
auth users = nobody
secrets file = /etc/rsyncd.secrets
#comment = This is RHEL 4 data
#exclude = easylife/ samba/
[rt]
path = /export/insurance/reconciliation/download/10014/

list=yes

ignore errors
auth users = nobody

secrets file = /etc/rsyncd.secrets

#>vim /etc/rsyncd.secrets用户名和密码

nobody:123456 

#chmod 400 /etc/rsyncd.secrets  

#/etc/init.d/xinetd restart

2.配置被同步机器端(10.24.182.238

#>vim /etc/rsync_client.pass

123456

#>chmod 600 /etc/rsync_client.pass 

#>rsync -avz --progress --delete --password-file=/etc/rsync_client.pass [email protected]::zd /export/sftp/zdlife/upload/

-u更新


你可能感兴趣的:(同步,rsync)