当前位置:网站首页>Rsync实现Win系统间的文件夹或数据同步
Rsync实现Win系统间的文件夹或数据同步
2022-07-30 05:44:00 【victorkevin】
安装文件:
链接:https://pan.baidu.com/s/1G6mzZ33AKNolIOUUM-cOYA
服务端:
cwRsyncServer_4.1.0_Installer.exe


use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
# 0代表不限定用户
uid = 0
gid = 0
# 本软件所用到的路径,如果是windows系统的文件路径都是以/cygdrive为前缀
[test]
path = /cygdrive/e/sync
read only = false
transfer logging = yes
# rsync的虚拟用户,此用户不是上面安装过程中输入的用户,是客户端连接的用户
auth users = test_rsync
# rsync的密码文件路径,以安装目录为相对路径
secrets file = rsync.password在安装目录下创建rsync.password,此文件是客户端连接时所使用的账号和密码列表,创建完毕后按下面步骤验证权限

确保用户Administrator对rsync.password有访问权限,如果没有则赋予读取权限,权限没问题就填写
就输入test_rsync:123456 冒号左边是用户名,右边是密码,注意注意注意:客户端同样也有这个文件但不需要左边,后面会提到这问题

最后检查RsyncServer的所使用的873端口是否启动,如果冲突则在rsync.conf上更改端口

客户端
安装文件:cwRsync_4.1.0_Installer.exe和chown.exe
安装结束后的目录结构,把chown.exe拷贝到bin目录下

在bin目录下创建client.password(不一定放在bin目录,这里只是为了方便),内容只要对应服务端中rsync.password中的密码123456
在运行同步之前需要为client.password密码文件授权,否则客户端程序无法访问,授权的方式可以界面操作(参照服务端),也可以在bin目录下运行
chmod.exe -c 600 /cygdrive/${path}/client.password
chown.exe administrator/cygdrive/${path}/client.password${path}指密码文件的本地路径,如/cygdrive/c/client.password 指c盘下面的client.password
chown.exe的改变文件属主的命令,当前我是以administrator运行客户端的命令,所以这里是为administrator授权
至此就可以运行客户端命令,注意:客户端执行的时候要在客户端的bin目录下,还有一种方式可以配环境变量:
rsync.exe -avz --password-file=client.password [email protected]::test /cygdrive/f/testwin_rsyncdi命令中的test_rsync是对应服务端中的rsync.password文件的用户
::test是对应服务端中rsync.conf中的test配置
最后在系统路径上f/testwin_rsyncdi看到同步过来的数据文件,如果希望在凌晨时间跑这个同步,可以在windows的任务计划上设置。
边栏推荐
猜你喜欢

MySQL 5.7 installation tutorial (all steps, nanny tutorials)

【面经】米哈游数据开发面经

MySQL 数据类型及占用空间

Student achievement management system (C language version)

"MySQL Advanced Chapter" four, the storage structure of the index

MySQL 5.7 安装教程(全步骤、保姆级教程)
![[MATLAB]图像处理——交通标志的识别](/img/45/1a5797a17ebf6db965a64c85e0f037.png)
[MATLAB]图像处理——交通标志的识别
Go简单实现协程池

Reasons and solutions for Invalid bound statement (not found)

21. Kotlin Advanced Learning: Implementing Simple Network Access Encapsulation
随机推荐
Remember a traffic analysis practice - Anheng Technology (August ctf)
正则表达式语法详解及实用实例
十三、Kotlin进阶学习:内联函数let、also、with、run、apply的用法。
MySQL window function
函数的信息传递(C语言实践)
MySQL - 函数及约束命令
Mysql 客户端常见异常分析
protobuf编码及网络通信应用(一)
Using PyQt5 to add an interface to YoloV5 (1)
Bypassing the file upload vulnerability
生产力工具分享——简洁而不简单
十五、Kotlin进阶学习:一、子类与子类型;二、协变;三、逆变;
Servlet basic principles and application of common API methods
MySQL achievement method 】 【 5 words, single table SQL queries
树莓派OpenCV+OpenCV-contrib
Detailed explanation of regular expression syntax and practical examples
Use kotlin to extend plugins/dependencies to simplify code (after the latest version 4.0, this plugin has been deprecated, so please choose to learn, mainly to understand.)
Monstache执行monstache -f config.toml出错No processor type exists with name [attachment] [type=parse_exc
Request请求体重新封装,解决请求体只能获取一次的问题
php vulnerability full solution