码迷,mamicode.com
首页 > 其他好文 > 详细

rsync异机备份

时间:2015-08-31 23:27:14      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:

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

 

rsync异机备份

标签:

原文地址:http://www.cnblogs.com/windyWu/p/4774293.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!