Chinaunix首页 | 论坛 | 博客
  • 博客访问: 88972
  • 博文数量: 69
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 697
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-03 23:44
文章分类

全部博文(69)

文章存档

2014年(69)

我的朋友

分类: LINUX

2014-05-03 23:55:55

从windows传文件到linux:
1、安装cwRsync_4.0.4_Installer.exe(默认路径安装)window只作为客户端,所以没装cwRsyncServer_4.0.4_Installer.exe
2、在C:\Program Files\cwRsync\bin新建rsync.bat,内容为:
 "C:\Program Files\cwRsync\bin\rsync.exe" -rlptDvzHS --port=873 --progress --exclude=Recycled --exclude=RECYCLER --exclude="System Volume Information" --password-file=/cygdrive/C/"Program Files"/cwRsync/bin/rsync.pass /cygdrive/e/mydirtest root@linux服务器IP::rsync模块名
3、在C:\Program Files\cwRsync\bin新建rsync.pass,内容为:root用户执行rsync的密码
4、新建chmod.bat 内容为:"C:\Program Files\cwRsync\bin\chmod.exe" 600 "/cygdrive/C/Program Files/cwRsync/bin/rsync.pass" 
5、执行chmod.bat 设置权限
6、执行rsync.bat,便将电脑上e盘的mydirtest传到linux服务器了。
从linux传文件到windows:
1、在windows安装cwRsyncServer_4.1.0_Installer.exe(默认路径安装)
2、windows上的rsyncd.conf配置信息:
cat  rsyncd.conf
use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log

# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#
[test]
path = /cygdrive/c/work
read only = false
transfer logging = yes
auth users = syncuser #同步使用的帐号 
secrets file = /cygdrive/c/Program Files/ICW/rsyncd.secrets #密码文件

cat rsyncd.secrets 
syncuser:123456

3、新建chmod.bat 内容为:
"C:\Program Files\ICW\bin\chmod.exe" 600 "/cygdrive/C/Program Files/ICW/bin/rsync.secrets" 
执行chmod.bat 设置权限
4、在linux测试命令:
/usr/bin/rsync -rlptDvzHS --port=873 --progress --password-file=/etc/rsyncd.syncuser_pwd  /a.txt   syncuser@192.168.10.2::test
阅读(2534) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~