`
swvip
  • 浏览: 150469 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

rsync数据同步

 
阅读更多
服务器
A : 172.16.9.170 服务端
B : 172.16.9.174 客户端
 
一 、服务器端配置  ---  172.16.9.170
 
安装rpm -q rsync
[root@SPD 123]# rpm -qa|grep rsync
 
配置/etc/rsyncd.conf
[root@SPD 123]#vi /etc/rsyncd.conf
 
####***************************************####
uid=nobody
gid=nobody
max connections = 200
timeout = 600
use chroot = no
read only = yes
pid file = /var/run/rsyncd.pid
host_allow = 172.16.9.174            //客户端的IP地址
#syslog facility = local7
#log file = /var/log/rsyncd.log
#rsync config
#The' standard' things
[rsync_gmmold]   //定义同步的路径(关键字为gmmold)
        path = /app/temp  //需要同步的路径
        comment = gmmold
####***************************************####
 
启动服务
[root@SPD 123]# /usr/bin/rsync --daemon
开机自动启动服务
echo "/usr/bin/rsync --daemon" >> /etc/rc.local
 

二、客户端的配置 ---  172.16.9.174
 
用命令同步
[root@dxczpt temp]#rsync -auqz 192.168.23.102::rsync_gmmold /app/temp
 
每半个小时同步一下
crontab -u root -e
 
0,30 * * * * rsync -auqz 172.16.9.125::rsync_gmmold /app/temp
 
解释
 
####***************####
* * * * *
分钟 小时 日 月 星期
####***************####
 
06 10 * * *
 
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics