s
OS + Linux File nfs / samba / rsync / inotify / smb / webdav
https://www.iteye.com/blog/user/lindows/blog/883586
RedHat Enterprise Linux 5.5 x64 Rsync Service
rsync clinet端取数据时,出Connection reset by peer 的错误。
http://bbs.chinaunix.net/thread-2119601-1-1.html
rsync配置
https://www.cnblogs.com/zhenhui/p/5715840.html
Server config 192.168.154.1:
[root@lindows ~]# more /etc/xinetd.d/rsync
- # default: off
- # description: The rsync server is a good addition to an ftp server, as it
- # allows crc checksumming etc.
- service rsync
- {
- disable = no
- socket_type = stream
- wait = no
- user = root
- server = /usr/bin/rsync
- server_args = --daemon
- log_on_failure += USERID
- }
开启rsync服务
[root@lindows ~]# chkconfig rsync on
编辑rsync配置
[root@lindows ~]# vim /etc/rsyncd .conf
- ####***************************************####
- [test]
- pid file = /var/run/rsyncd.pid
- log file = /var/log/rsyncd.log
- path = /opt
- uid=root
- gid=root
- max connections = 200
- timeout = 600
- use chroot = no
- read only = yes
- list = yes
- ignore errors
- #auth user = root
- host_allow = *
- syslog facility = local3
- #rsync config
- #The' standard' things
启动rsync进程
[root@lindows ~]# /usr/bin/rsync --daemon --config=/etc/rsyncd.conf
[root@lindows ~]# ps -ef | grep rsyncd
root 6421 1 0 00:02 ? 00:00:00 /usr/bin/rsync --daemon --config=/etc/rsyncd.conf
root 7376 5082 0 00:29 pts/1 00:00:00 grep rsyncd
检查rsync端口
[root@localhost opt]# grep rsync /etc/services
rsync 873/tcp # rsync
rsync 873/udp # rsync
airsync 2175/tcp # Microsoft Desktop AirSync Protocol
airsync 2175/udp # Microsoft Desktop AirSync Protocol
[root@localhost opt]# netstat -an | grep :873
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN
tcp 0 0 :::873 :::* LISTEN
[root@localhost opt]# mkdir -p /opt/146soft
Clinet Rsync config 192.168.154.142:
查看rsync同步列表
[root@localhost opt]# rsync --list-only 192.168.154.146:/opt/
或
root@localhost opt]# rsync --list-only root@192.168.154.146:/opt/
drwxr-xr-x 4096 2011/05/26 23:44:12 .
drwxr-xr-x 4096 2011/05/26 23:35:55 54.146_soft
测试rsync同步全部数据 ok
[root@localhost opt]# rsync -auqz 192.168.154.146::test /opt/
测试rsync同步增量数据 ok
[root@localhost opt]#/usr/bin/rsync -avuztorpg --delete --progress 192.168.154.146::test ./ >> /opt/rsync_log/rsync_$HOSTNAME.log
或
[root@localhost opt]#/usr/bin/rsync -avuztorpg --delete --progress root@192.168.154.146::test ./ >> /opt/rsync_log/rsync_$HOSTNAME.log
http://www.ryong21.com/archives/576.html
rsync error: timeout in data send/receive
如果同步的文件很多,rsync客户端会出现这样的错误:
rsync error: timeout in data send/receive (code 30) at io.c(171) [sender=2.6.8]
rsync: connection unexpectedly closed
在rsync命令中加上–timeout=TIME 设置 I/O 超时时间就可以了。TIME单位是秒。
rsync的各种返回值的含义:
http://www.codelast.com/?p=796
0 Success
1 Syntax or usage error
2 Protocol incompatibility
3 Errors selecting input/output files, dirs
4 Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support them; or an option was specified that is supported by the client and not by the server.
5 Error starting client-server protocol
10 Error in socket I/O
11 Error in file I/O
12 Error in rsync protocol data stream
13 Errors with program diagnostics
14 Error in IPC code
20 Received SIGUSR1 or SIGINT
21 Some error returned by waitpid()
22 Error allocating core memory buffers
23 Partial transfer due to error
24 Partial transfer due to vanished source files
30 Timeout in data send/receive
end