cwrsync数据同步

 WINDOWS下cwRsync搭建步骤:


1、http://rsync.samba.org/ 下载cwRsync客户端(cwRsync)和服务器端(cwRsyncServer)。
2、在客户端安装cwRsync。
3、在服务端安装cwRsyncServer。
4、配置服务端rsyncd.conf。
例如:
[test]
path=e:/test
comment=Data Backup for Summer's laptop
read only=no
use chroot=no
strict modes = no
transfer logging=yes
use lfs=yes
hosts allow=172.25.43.57
hosts deny=*
/*上面是设置了一个test模块,相关配置在下面解释*/
5、重起服务端cwRsyncServer。
6、搭建已经完毕,可以开始命令操作。
rsync -avrp /test/ administrator@172.25.43.58::test --password-file=1234567
(表示将客户端test目录下文件备份到服务器test模块下。如果将/test/放后面,表示将服务器test模块下目录备份带客户端/test/下。)
选项说明:
-v, --verbose 详细模式输出
-q, --quiet 精简输出模式
-c, --checksum 打开校验开关,强制对文件传输进行校验
-a, --archive 归档模式,表示以递归方式传输文件,并保持所有文件属性,等于-rlptgoD
-r, --recursive 对子目录以递归模式处理
-R, --relative 使用相对路径信息
其他参数可以查看rsync相关手册。


相关解释:
uid = nobody
gid = nobody
use chroot = no        # 不使用chroot
max connections = 4        # 最大连接数为4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log    # 日志记录文件
[inburst]            # 这里是认证的模块名,在client端需要指定
path = /home/inburst/python/    # 需要做镜像的目录
comment = BACKUP CLIENT IS SOLARIS 8 E250
ignore errors            # 可以忽略一些无关的IO错误
read only = yes            # 只读
list = no            # 不允许列文件
hosts allow=172.25.43.57  #允许连接IP
auth users = inburst        # 认证的用户名,如果没有这行,则表明是匿名
secrets file = /etc/inburst.pas    # 认证文件名

注:
为安全考虑,在设置服务端rsyncd.conf模块时,最好加上auth users = inburst,secrets file = /etc/inburst.pas,密码写到一个文件中inburst.pas。
执行命令时:rsync -avrp /test/ inburst@172.25.43.158::test --password-file=inburst.pas。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值