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

rsync 文件同步 服务器和客户端配置

时间:2015-09-07 19:39:04      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:rsync

rsync 配置:

#解压:
tar zxvf rsync-3.1.1.tar.gz
cd rsync-3.1.1
#编译安装
./configure --prefix=/usr/local/rsync
make
make install

#################服务端:

vi /etc/xinetd.d/rsync
         将其中改成:  disable = no

#随系统启动RSYNC
chkconfig rsync on

#配置/etc/rsyncd.conf(需要手动生成,不加注释)

uid = root  
gid = root
use chroot = no
max connections = 4   
strict modes = no               
port = 873                      

pid file = /var/run/rsyncd.pid      
lock file = /var/run/rsync.lock     
log file = /var/log/rsyncd.log      

[test]
path = /data/test
hosts allow = 121.40.53.233
auth users = test
secrets file = /etc/rsync.pas

#  配置/etc/rsync.pas 用户密码
test:123qwe

#赋权限
chown root.root /etc/rsync.pas
chmod 600 /etc/rsync.pas

# 启动
/usr/local/rsync/bin/rsync  --daemon

# 检查rsync
netstat -a | grep rsync

################# 客户端:

#  配置/etc/rsync.pas 用户密码
123qwe

#赋权限
chown root.root /etc/rsync.pas
chmod 600 /etc/rsync.pas

#同步文件
/usr/local/rsync/bin/rsync  -vzrtopg --progress --exclude=.svn --delete test@121.40.172.94::test /home/backup --password-file=/etc/rsync.pas


/usr/local/rsync/bin/rsync  -vzrtopg --progress --exclude=.svn --delete test@121.40.110.187::test /tmp/blockip --password-file=/etc/rsync.pas

本文出自 “apache323” 博客,请务必保留此出处http://apache323.blog.51cto.com/6134209/1692449

rsync 文件同步 服务器和客户端配置

标签:rsync

原文地址:http://apache323.blog.51cto.com/6134209/1692449

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