rsync服务安装和配置

 

作者: javaboy2012
Email:yanek@163.com
qq:    1046011462


rsync服务安装和配置

rsync服务安装:


检查是否安装:

rpm -qa | grep rsync

如果安装了,则需要做如下配置和修改

1. 修改 /etc/xinetd.d/rsync 下的内容

 打开启动选项:

disable = yes 改为 disable = no


cat /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
}

 

 

2. 新建:vi /etc/rsyncd.conf

输入如下内容:

uid = root
gid = root
use chroot = no
max connections = 10
strict modes = yes

pid file=/opt/myysrnc/rsyncd.pid

lock file=/opt/myysrnc/rsyncd.lock

log file= =/opt/myysrnc/rsyncd.log

[www]
path= /data/www
comment= analyse
read only = false
hosts allow = *


3. 启动守护进程

  /usr/local/bin/rsync --daemon

 

客户端:

  执行同步命令:

  /usr/bin/rsync -arzuv /data/www/ 192.168.136.128::www/


 注意:客户端必须执行同步命令触发同步操作.

 要实现定时同步,可以通过crontab -e加入定时任务来实现.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值