Chinaunix首页 | 论坛 | 博客
  • 博客访问: 246849
  • 博文数量: 61
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 800
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-14 15:18
文章分类

全部博文(61)

文章存档

2011年(4)

2010年(5)

2009年(10)

2008年(42)

我的朋友

分类: LINUX

2008-08-28 16:03:38

服务器端:(10.0.0.158)
1. 确认安装 rsync
2. 建立并配置 /etc/rsyncd.conf
secrets file = /etc/rsyncd.pwd
motd file = /etc/rsync.motd
read only = yes
list = yes
uid = nobody
gid = nobody
hosts allow = 10.0.0.126
hosts deny = 0.0.0.0/0
max connections = 4
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
[TEST]
comment =
path = /source/test
auth users = user_test
 
[Share]
comment =
path = /source/share
auth users = user_admin
 
3.建立密码文件 /etc/rsyncd.pwd
指定用户密码
echo user_test:password >> /etc/rsyncd.pwd
修改文件属性: chmod 600 /etc/rsyncd.pwd
 
4.启动rsync服务
[root@DB_Backup log]# rsync --daemon
检查服务,端口为873
[root@DB_Backup log]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:873                 0.0.0.0:*                   LISTEN      26827/rsync
 
 
客户端(10.0.0.126):
1. 建立密码文件 /etc/rsync.pwd
输入对应密码: echo password >> /etc/rsync.pwd
修改文件属性: chmod 600 /etc/rsync.pwd
2. 同步文件:
rsync -vazu --progress --password-file=/etc/rsync.pwd  

 
 
 
阅读(880) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~