`

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

分享到:
评论

相关推荐

    rsync window 服务端

    "rsync window 服务端"指的是在Windows上搭建rsync服务器,以便实现跨平台的数据同步。 cwRsync是Cygwin环境下构建的rsync和OpenSSH的集合,它提供了一个与原生Linux版rsync相似的环境,使得Windows系统可以支持...

    cwRsync-4.0.5-Installer客户端安装包

    这个4.0.5版本的安装包旨在帮助Windows用户方便地与各种系统(包括其他Windows服务器、Linux服务器以及群晖NAS等)进行文件的同步和备份操作。 **主要特点:** 1. **跨平台兼容性**:cwRsync使得Windows用户能够...

    sources-linux常用命令大全

    Linux操作系统作为一套功能强大的开源系统,在服务器、桌面应用以及嵌入式系统中都有广泛的应用。掌握Linux常用命令是进行系统管理、网络配置、软件开发和维护的基础。《sources-linux常用命令大全》的文件内容可能...

    unix power tools 3ed.pdf

    - **备份工具**: 使用`tar`, `rsync`等工具进行备份。 - **云备份**: 如何使用云服务进行远程备份。 **7.2 创建和读取存档 (Chapter 39: Creating and Reading Archives)** - **归档工具**: 使用`tar`, `zip`, `rar...

Global site tag (gtag.js) - Google Analytics