论坛首页 综合技术论坛

rsync数据同步

浏览 2494 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2010-04-13  
服务器
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