rsync在服务器之间通信备份(包括window和linux之间)

rsync在服务器之间通信备份(包括window和linux之间):
linux和linux之间:

服务器:192.168.1.1
客户端:192.168.1.2


服务端:

uid = nobody
gid = nobody
use chroot = no
max connections = 3
transfer logging = true
log format = %h %o %f %l %b
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
hosts allow = 192.168.1.2

[project]
path = /home/hosts/
exclude = app_log/ resin_log/ *.tar.gz *.tar *.gz *.zip .*
comment = BACKUP CLIENT IS SOLARIS 8 E250
ignore errors
read only = yes
list = no
auth users=rsync_guagua
secrets file = /etc/rsyncd.secrets

配置一下密码文件即可。
文件格式如下:rsync_guagua:111111(用户名:密码)

客户端:
rsync -vzrtopg --progress --update rsync_guagua@192.168.1.1::project $mainProjectDir/26 --password-file=/usr/local/bin/rsyncd.pwd>/var/log/rsync.26.prj.$DATE.log
配置下密码文件:只需配置密码,如:111111


linux和linux的通讯完成。

linux和window的通讯,linux为客户端,window为服务端

window需要安装cwRsyncServer软件。安装后,修改安装目录的rsync.conf文件,然后去服务中手动启动该服务即可。
注:该软件监听的是873端口,请确保防火墙打开此端口

服务端配置如下:
UID = 0
GID = 0
use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
pid file = rsyncd.pid

[test]
path = /cygdrive/e/test
read only = yes
transfer logging = yes
ignore errors
list = no
auth users=rsync_guagua
secrets file = /cygdrive/e/rsyncd.secrets

改配置同linux服务端不一样的是UID和GID,这里必须这样配置,否则报错
@ERROR: invalid uid nobody
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.2]

客户端同linux,客户端的密钥文件必须具有600的权限,否则报错:
password file must not be other-accessible


下面收藏一个rsync常出错的错误信息收集地址:
http://www.codesky.net/article/201202/162163.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值