找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 服务器 Linux/BSD 查看内容

linux 下rsync数据同步

2009-12-20 13:15| 发布者: admin| 查看: 94| 评论: 0|原作者: 云天青

服务器
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
解释
####***************####
* * * * *
分钟 小时 日 月 星期
####***************####







最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 17:21 , Processed in 0.267744 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部