rsync 常見錯誤及解決方法

1、ERROR: chroot failed

ERROR: chroot failed rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]

原因:服務器端的目錄不存在或無權限。

解決辦法:創建目錄並修正權限可解決問題。

2、skipping non-regular file

receiving incremental file list

skipping non-regular file “vendor/bin/doctrine”

skipping non-regular file “vendor/bin/doctrine.php”

sent 1990 bytes received 489209 bytes 327466.00 bytes/sec total size is 182515746 speedup is 371.57

原因:source源文件有軟鏈接。

解決方法:修改爲 rsync -va,其中 -a == -rlptgoD (no -H,-A,-X) 或者 rsync -rvltOD 也可以。

解決後:

receiving incremental file list

vendor/bin/doctrine -> ../doctrine/orm/bin/doctrine

vendor/bin/doctrine.php -> ../doctrine/orm/bin/doctrine.php

sent 1998 bytes received 489279 bytes 327518.00 bytes/sec total size is 182515746 speedup is 371.51

3、ERROR: module is read only

sending incremental file list

ERROR: module is read only

rsync error: syntax or usage error (code 1) at main.c(866) [receiver=3.0.6]

rsync: read error: Connection reset by peer (104)

rsync error: error in rsync protocol data stream (code 12) at io.c(759) [sender=3.0.6]

原因:source源服務器端權限設置read爲only只讀權限。

解決方法:read only = false

4、ERROR: auth failed on module tee

ERROR: auth failed on module tee rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.6]

原因:服務器端該模塊(tee)需要驗證用戶名密碼,但客戶端未提供正確的用戶名密碼,認證失敗。

解決方法:提供正確的用戶名密碼解決此問題。

5、ERROR: Unknown module ‘tee_nonexists’

ERROR: Unknown module ‘tee_nonexists’ rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.6]

原因:服務器不存在指定模塊。

解決方法:提供正確的模塊名或在服務器端修改成你要的模塊以解決問題。

6、password file must not be other-accessible

password file must not be other-accessible

continuing without password file

Password:

原因:這是因爲rsyncd.pwd rsyncd.secrets的權限不對,應該設置爲600。

解決方法:chmod 600 rsyncd.pwd

7、rsync: failed to connect No route to host

rsync: failed to connect to 192.168.1.10: No route to host (113) rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=3.0.6]

原因:對方沒開機、防火牆阻擋、通過的網絡上有防火牆阻擋,都有可能。

解決方法:在iptables 中開放該端口,語句如下:

iptables -I INPUT -p tcp –dport 873 -j ACCEPT

rsync默認端口873,其實就是把tcp udp的873端口打開。

8、rsync error: error starting client-server protocol

rsync error: error starting client-server protocol (code 5) at main.c(1524) [Receiver=3.0.6]

原因:/etc/rsyncd.conf配置文件內容有錯誤。請正確覈對配置文件。

9、rsync: chown “” failed: Invalid argument (22)

rsync: chown “” failed: Invalid argument (22)

原因:權限無法複製。去掉同步權限的參數即可。(這種情況多見於Linux向Windows的時候)

10、問題 @ERROR: daemon security issue — contact admin

@ERROR: daemon security issue — contact admin rsync error: error starting client-server protocol (code 5) at main.c(1530) [sender=3.0.6]

原因:同步的目錄裏面有權限不足的軟連接文件,需要服務器端的/etc/rsyncd.conf打開use chroot = yes。

11、 rsync: read error: Connection reset by peer (104)

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.6]

解決:很大可能是服務器端沒有開啓 rsync 服務,開啓服務。

12、ERROR: failed to open lock file

@ERROR: failed to open lock file rsync error: error starting client-server protocol (code 5) at main.c(1495) [receiver=3.0.6]

解決:配置文件 rsync.conf 中添加 lock file = rsyncd.lock 即可解決。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章