Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1374439
  • 博文数量: 264
  • 博客积分: 5810
  • 博客等级: 大校
  • 技术积分: 3528
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-13 17:15
文章分类

全部博文(264)

文章存档

2011年(264)

分类: 系统运维

2011-04-06 22:33:46

01.创建rsync文件vi  /etc/xinetd.d/rsync
内容如下:
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
#       allows crc checksumming etc.
service rsync
{
        disable = no
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
}
02.创建rsync配置文件vi /etc/rsyncd.conf
uid     = nobody
gid     = nobody
use chroot      = yes
max connections = 30
pid file=/var/run/rsyncd.pid
log file=/var/log/rsyncd.log
list = no
[5j_test]
path            = /mnt/mfs/5j_test
hosts allow     = 192.168.0.0/8
read only       = no
03.重启服务
/etc/init.d/xinetd restart
说明:
有些机器上面可能没有安装xinetd服务需要yum install 一下!

现在可以测试
rsync  -Rravz  --port=873 --delete  * 192.168.0.117::5j_test
将本地的文件推到这台rsync服务器上面去!一般配置采用这种形式即可满足需求了。

还可以用这种办法:
rsync -auz  --files-from=rsync /home/unix-c/  119.161.xxx.xxxx::5j_test
其中rsync文件内容如下
more rsync
a
b
以\n分开即可!
阅读(972) | 评论(1) | 转发(1) |
给主人留下些什么吧!~~

yaofang1232011-04-18 17:30:37

rsync  -Rravz  --port=873 --delete --files-from=rsync  * 192.168.0.117::5j_test
通过定义一个同步文件可以一次同步多个文件。