rsync 守护进程配置(含脚本)

1 系统信息

[root@rsync-30 elk]# cat /etc/redhat-release 
CentOS release 6.8 (Final)

[root@rsync-30 elk]# uname -r
2.6.32-642.el6.x86_64


2 rsync 服务端daemon配置

#! /bin/bash
# function :rsync daemon config


function rsync_daemon_confing()
{
/usr/sbin/groupadd rsync
/usr/sbin/useradd rsync -s /sbin/nologin -M -g rsync
mkdir /soft/lnmp -p
mkdir /soft/elk -p
cat >/etc/rsyncd.conf <<EOF
##rsyncd.conf start##
uid = rsync
gid = rsync
use chroot = no
max connections = 200
timeout = 300
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = false
list = false
hosts allow = 10.0.0.0/24
hosts deny = 0.0.0.0/32
auth users = rsync_backup
secrets file = /etc/rsync.password


[lnmp]
path = /soft/lnmp
[elk]
path = /soft/elk


EOF
echo "rsync_backup:12356">/etc/rsync.password
chmod 600 /etc/rsync.password
rsync --daemon
}



3 rsync客户端配置

配置密码:
echo "123456">/etc/rsync.password
chmod 600 /etc/rsync.password


客户端拉文件:
rsync -avz rsync_backup@10.0.0.30::lnmp /data --password-file=/etc/rsync.password 


推整个文件夹
rsync -avz /data rsync_backup@10.0.0.30::lnmp  --password-file=/etc/rsync.password  


推/data文件夹的内容
rsync -avz /data/ rsync_backup@10.0.0.30::lnmp  --password-file=/etc/rsync.password






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值