rsync异机备份

参考http://www.cnblogs.com/itech/archive/2009/08/10/1542945.html

1、服务器

新建/etc/rsyncd.conf  ->新建/etc/rsyncd.secrets ->运行rsync --daemon或修改/etc/xinetd.d/rsync(修改后,须执行service xinetd restart)

vi /etc/rsyncd.conf

  

# Distributed under the terms of the GNU General Public License v2
# Minimal configuration file for rsync daemon
# See rsync(1) and rsyncd.conf(5) man pages for help

# This line is required by the /etc/init.d/rsyncd script
port = 873
address = 192.168.0.106
uid = root
gid = root

use chroot = no
read only = yes

#limit access to private LANs
hosts allow=192.168.0.109
hosts deny=*
max connections = 5

#This will give you a separate log file
log file = /var/log/rsync.log

[test]
#指定文件目录所在位置,这是必须指定的 
path = /root/test
list=yes
ignore errors
#认证用户必须在服务器上存在的用户
auth users = root
#含有上行的用户
secrets file = /etc/rsyncd.secrets
comment = This is test data
#exclude = exclude file or dir
vi /etc/rsyncd.secrets
root:pwd

2、客户端

首先:我们看看rsync服务器上提供了哪些可用的数据源

rsync  --list-only  root@192.168.145.5::

然后:同步数据

rsync -avzP root@192.168.145.5::test test

 

转载于:https://www.cnblogs.com/windyWu/p/4774293.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值