Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1787389
  • 博文数量: 787
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5015
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-22 15:17
文章分类

全部博文(787)

文章存档

2008年(787)

我的朋友

分类:

2008-09-25 16:06:32

我用Ubuntu的系统。  在rsync客户端手动执行脚本的话,是可以正常同步的。 但是如果把脚本在cron中每隔10分钟执行一次的话,就不能正常同步。
server端的日志如下:
2008/06/23 11:57:33 [24489] params.carameter() - Ignoring badly formed line in configuration file: ignore errors
2008/06/23 11:57:33 [24489] params.carameter() - Ignoring badly formed line in configuration file: ignore errors
2008/06/23 11:57:34 [24489] connect from backup.local (10.23.28.203)
2008/06/23 11:57:34 [24489] rsync on mysql-bug from (10.23.28.203)
2008/06/23 11:57:34 [24489] building file list
2008/06/23 11:57:34 [24489] rsync: writefd_unbuffered failed to write 4 bytes [sender]: Connection reset by peer (104)
2008/06/23 11:57:34 [24489] rsync error: error in rsync protocol data stream (code 12) at io.c(1123) [sender=2.6.9]


server端的rsyncd.conf的配置如下:
# created by songtao at 2007/12/18
# This script is make a mirror for where is from lx-beijing101 machine's SVN Source Codes  to localhost directory  and lx-beijing280# This script is the config file of rsync serv
er .

use chroot = no
max connections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log

[svn]
path = /data/SVN_REPOS/
ignore errors
read only = true
list = false
hosts allow = 10.23.28.219
hosts deny = 0.0.0.0/32
uid = root
gid = root
auth users = rs
secrets file = /etc/rsyncd.pwd

[mysql-bug]
path = /data/mysql-bug/           
ignore errors
read only = true
list = false
hosts allow = 10.23.28.219
hosts deny = 0.0.0.0/32
uid = root
gid = root
auth users = rs
secrets file = /etc/rsyncd.pwd


客户端的备份脚本如下:
#!/bin/bash
# This script is make a mirror for that backup SVN source codes from lx-beijing101 machine /data/SVN_REPOS/ to lx-beijing280 machine
#/backup-svn/SVN_REPOS/ ;

export PATH=/usr/local/bin:/usr/bin:/bin

#define backup directory;
backupdir=/backup/backup-svn/SVN_REPOS/
backupdir2=/backup/backup-svn/mysql-bug/

#make a mirror for copy lx-beijing101 svn source code to lx-beijing280;
/usr/bin/rsync -vzrtopg --delete --progress ::svn $backupdir --password-file=/etc/rsyncd.pwd

#make a mirror for copy lx-beijing101 svn mysql-bug database to lx-beijing280;
/usr/bin/rsync -vzrtopg --delete --progress ::mysql-bug $backupdir2 --password-file=/etc/rsyncd.pwd      
--------------------next---------------------

阅读(773) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~