大旗谷资源网 Design By www.zqyou.com
windows做为文件服务器,使用rsync的windows服务版本:cwRsyncServer 下载地址:http://rsync.samba.org
安装过程要设置用于系统服务的帐号和密码,可以默认。
注:此帐号用于启用crsync server服务,需要分配给帐号对要同步文件的相应权限,否则无法操作被同步的文件。
安装完成后修改配置文件 rsyncd.conf, 配置文件内容如下:
复制代码 代码如下:
port = 52326
use chroot = false
strict modes = false
#hosts allow = * #允许所有的访问
hosts allow = 192.168.10.2 #指定特定的IP允许访问
log file = rsyncd.log
lock file = rsyncd.lock
max connections = 10
UID = 0
GID = 0
# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#
[test]
path = /cygdrive/c/work
read only = false
transfer logging = no
[test2]
path = /cygdrive/d/wwwroot/yanghengfei_com
read only = yes
transfer logging = no
auth users = coldstar #同步使用的帐号
secrets file = rsyncd.secrets #密码文件
注:
rsyncd.secrets配置文件的格式为 用户名:密码,如:
coldstar:123456
即添加了一个用户 coldstar,密码为 123456。
Linux服务器上执行同步命令:
rsync -vzrtopg --progress --delete rsync://coldstar@192.168.10.1:52326/test2 /root/test2
然后在password: 提示符下输入密码即可。
也可以把密码写入配置文件引用,如:
rsync -vzrtopg --progress --delete --password-file=/etc/rsync.pass rsync://coldstar@192.168.10.1:52326/test2 /www/users/yanghengfei_com
将以上命令写入计划任务,每1分钟执行,即可实现实时同步的效果。
注:
上面这个命令行中-vzrtopg里的v是verbose,z是压缩,r是recursive,topg都是保持文件原有属性如属主、时间的参数。-- progress是指显示出详细的进度情况,--delete是指如果服务器端删除了这一文件,那么客户端也相应把文件删除,保持真正的一致。
附,rsync使用时的常见问题:
错误1: rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(794) [receiver=3.0.2]
解决:很大可能是服务器端没有开启 rsync 服务。开启服务。 或者开启了防火墙指定的端口无法访问。
错误2:@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1495) [receiver=3.0.2]
解决:服务器端同步目录没有权限,cwrsync默认用户是Svcwrsync。为同步目录添加用户Svcwrsync权限。
错误3:@ERROR: failed to open lock file
rsync error: error starting client-server protocol (code 5) at main.c(1495) [receiver=3.0.2]
解决:服务器端配置文件 rsyncd.conf中添加 lock file = rsyncd.lock 即可解决。
错误4:@ERROR: invalid uid nobody
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.2]
解决:在rsyncd.conf文件中添加下面两行即可解决问题
UID = 0
GID = 0
错误5:@ERROR: auth failed on module test2
rsync error: error starting client-server protocol (code 5) at main.c(1296) [receiver=3.0.2]
解决:服务端没有指定正确的secrets file,请在 [test2]配置段添加如下配置行:
auth users = coldstar #同步使用的帐号
secrets file = rsyncd.secrets #密码文件
错误6:password file must not be other-accessible
解决:客户端的pass文件要求权限为600, chmod 600 /etc/rsync.pass 即可。
安装过程要设置用于系统服务的帐号和密码,可以默认。
注:此帐号用于启用crsync server服务,需要分配给帐号对要同步文件的相应权限,否则无法操作被同步的文件。
安装完成后修改配置文件 rsyncd.conf, 配置文件内容如下:
复制代码 代码如下:
port = 52326
use chroot = false
strict modes = false
#hosts allow = * #允许所有的访问
hosts allow = 192.168.10.2 #指定特定的IP允许访问
log file = rsyncd.log
lock file = rsyncd.lock
max connections = 10
UID = 0
GID = 0
# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#
[test]
path = /cygdrive/c/work
read only = false
transfer logging = no
[test2]
path = /cygdrive/d/wwwroot/yanghengfei_com
read only = yes
transfer logging = no
auth users = coldstar #同步使用的帐号
secrets file = rsyncd.secrets #密码文件
注:
rsyncd.secrets配置文件的格式为 用户名:密码,如:
coldstar:123456
即添加了一个用户 coldstar,密码为 123456。
Linux服务器上执行同步命令:
rsync -vzrtopg --progress --delete rsync://coldstar@192.168.10.1:52326/test2 /root/test2
然后在password: 提示符下输入密码即可。
也可以把密码写入配置文件引用,如:
rsync -vzrtopg --progress --delete --password-file=/etc/rsync.pass rsync://coldstar@192.168.10.1:52326/test2 /www/users/yanghengfei_com
将以上命令写入计划任务,每1分钟执行,即可实现实时同步的效果。
注:
上面这个命令行中-vzrtopg里的v是verbose,z是压缩,r是recursive,topg都是保持文件原有属性如属主、时间的参数。-- progress是指显示出详细的进度情况,--delete是指如果服务器端删除了这一文件,那么客户端也相应把文件删除,保持真正的一致。
附,rsync使用时的常见问题:
错误1: rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(794) [receiver=3.0.2]
解决:很大可能是服务器端没有开启 rsync 服务。开启服务。 或者开启了防火墙指定的端口无法访问。
错误2:@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1495) [receiver=3.0.2]
解决:服务器端同步目录没有权限,cwrsync默认用户是Svcwrsync。为同步目录添加用户Svcwrsync权限。
错误3:@ERROR: failed to open lock file
rsync error: error starting client-server protocol (code 5) at main.c(1495) [receiver=3.0.2]
解决:服务器端配置文件 rsyncd.conf中添加 lock file = rsyncd.lock 即可解决。
错误4:@ERROR: invalid uid nobody
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.2]
解决:在rsyncd.conf文件中添加下面两行即可解决问题
UID = 0
GID = 0
错误5:@ERROR: auth failed on module test2
rsync error: error starting client-server protocol (code 5) at main.c(1296) [receiver=3.0.2]
解决:服务端没有指定正确的secrets file,请在 [test2]配置段添加如下配置行:
auth users = coldstar #同步使用的帐号
secrets file = rsyncd.secrets #密码文件
错误6:password file must not be other-accessible
解决:客户端的pass文件要求权限为600, chmod 600 /etc/rsync.pass 即可。
标签:
rsync,文件同步
大旗谷资源网 Design By www.zqyou.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
大旗谷资源网 Design By www.zqyou.com
暂无用rsync实现windows与linux文件同步的方法的评论...
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。
更新日志
2024年09月19日
2024年09月19日
- 张宇.1995-一言难揪EMI百代】【WAV+CUE】
- 尹毓恪.2018-浴室与太平洋【海蝶】【FLAC分轨】
- 《遗迹2:黑暗的视界》发布全新职业护卫者预告片,将于9月25日上线
- 好评如潮《彼方的她》迎来首次大型更新
- 《最终幻想16》PC版震撼登场 官方发布精彩宣传片
- 《中国十大国语老歌.男人篇 3CD》[WAV/分轨][1.5GB]
- 《汽车音响极品流行热曲发烧大碟 情伤 男声篇2CD》[WAV/分轨][980MB]
- 《绝版经典情歌 国语老歌 内地珍藏篇 2CD》[WAV/分轨][1.2GB]
- 崩坏星穹铁道冬城史学家成就获得攻略
- 金铲铲之战符文大陆城邦效果分享 有哪些效果
- 仙境传说新启航单手斧流派技能流铁匠玩法介绍
- 归龙潮笼鸟意未平任务怎么完成 笼鸟意未平任务流程攻略
- 归龙潮长命锁指引任务怎么过 长命锁的指引前进任务攻略
- 归龙潮破败小屋密码是什么 尘封的记忆支线攻略
- 瑞鸣音乐《中国音乐地图之听见西藏HQCD》[WAV]