rsync同步出錯以及解決辦法。


1、@ERRPR:chdir failed

錯誤原因:

服務器端沒有提供訪問的目錄 /backup

處理方法:

需要在服務器端創建,並賦予權限rsync管理權限

mkdir /backup

chown -R rsync.rsync /backup/

 

2、@ERROR: auth failed on module backup

查看 服務端/etc/rsync.password 配置文件是否有問題

比如:

多余的空格 空行

rsync error: error startingclient-serverprotocol (code 5) at main.c(1503) [sender=3.0.6]

錯誤原因

1>    客戶端密碼文件的權限不是600

2>    服務端密碼文件不是600

3>    服務端密碼文件不存在(名字寫錯了/沒有創建/配置文件參數寫錯了)

4>    服務端密碼文件里保存的用戶名和密碼不正確

 

3、@ERROR:invalid uid rsync

不可用的uid

useradd rsync -s /sbin/nologin -M

 

4、@ERROR: chroot failed

@ERROR:chroot failed

rsyncerror: error starting client-server protocol (code 5) at main.c(1522)[receiver=3.0.3]

 

服務器端的目錄不存在或無權限,創建目錄並修正權限可解決問題。

 

5、@ERROR: auth failed on module tee

 rsync error: error starting client-serverprotocol (code 5) at main.c(1522) [receiver=3.0.3]

 

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

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

 

6、@ERROR: Unknown module ‘tee_nonexists'

 rsync error: error starting client-serverprotocol (code 5) at main.c(1522) [receiver=3.0.3]

 

服務器不存在指定模塊。提供正確的模塊名或在服務器端修改成你要的模塊以解決問題。

1>    推送/拉取命令寫錯了

2>    服務端模塊名字寫錯了

 

7、rsync: --passwork-file=/etc/rsync.password: unknown option

rsync: --passwork-file=/etc/rsync.password:unknown option

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

錯誤原因:

/etc/rsync.password文件名稱寫錯

解決方法:

更正/etc/rsync.password文件名稱

8、rsync: ERROR:cannot stat destination

sending incremental file list

rsync: ERROR: cannot stat destination"." (in backup): Permission denied (13)

rsync error: errors selecting input/outputfiles, dirs (code 3) at main.c(554) [receiver=3.0.6]

rsync: connection unexpectedly closed (5bytes received so far) [sender]

rsync error: error in rsync protocol datastream (code 12) at io.c(600) [sender=3.0.6]

錯誤原因:

服務端rsync對目錄操作權限不足

解決方法:

修改對應目錄權限755

[root@oldboy~]# chmod 755 /backup/

[root@oldboy~]# ll -ld /backup/

drwxr-xr-x.12 rsync rsync 4096 Sep 23 19:17 /backup/

 

9、rsync: write failed on "/home/backup2010/ ": No space lefton device (28)

rsync:write failed on "/home/backup2010/wensong": No space left on device(28)

rsyncerror: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]

rsync:connection unexpectedly closed (2721 bytes received so far) [generator]

rsyncerror: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]

問題原因:

磁盤空間不夠,所以無法操作。

解決方法:

可以通過df /home/backup2010 來查看可用空間和已用空間

 

10、rsync: opendir "/kexue" (in dtsChannel) failed: Permissiondenied (13)

 

注意查看同步的目錄權限是否為755

 

11、rsync: failed to connect to 203.100.192.66: Connection timed out(110)

rsync:failed to connect to 203.100.192.66: Connection timed out (110)

rsyncerror: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]

檢查服務器的端口netstat ?tunlp,遠程telnet測試。

可能因為客戶端或者服務端的防火牆開啟 導致無法通信,可以設置規則放行 rsync(873端口) 或者直接關閉防火牆。

關服務端selinux 和iptabs 防火牆

 

還有一種在同步過程中可能會提示沒有權限 (將同步目錄加上SvcwRsync全部權限即可,更簡單的方法就是將SvcwRsync設為管理員即可)

需要給/etc/rsync.password 600權限

[root@backup backup]# ll -ld/etc/rsync.password

-rw-------. 1 root root 20 Sep 22 21:16/etc/rsync.password

12、rsync: failed to connect to 10.10.10.170: Connection refused (111)

rsync:failed to connect to 10.10.10.170: Connection refused (111)

rsyncerror: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]

 

啟動服務:rsync --daemon--config=/etc/rsyncd.conf

 

 

13 、rsync:recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No spaceleft on device (28)

 *** Skipping any contents from this faileddirectory ***

 

磁盤空間滿

 

14、rsync error: received SIGINT, SIGTERM, orSIGHUP (code 20) at rsync.c(544) [receiver=3.0.5]

rsyncerror: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544)[generator=3.0.5]

 

 

Ctrl+C或者大量文件

 

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

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

 rsync error: error in rsync protocol datastream (code 12) at io.c(759) [receiver=3.0.5]

 

xnetid啟動

查看rsync日志

rsync: unable to open configuration file"/etc/rsyncd.conf": No such file or directory

xnetid查找的配置文件位置默認是/etc下,根據具體情況創建軟鏈接。例如:

ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf

或者更改指定默認的配置文件路徑,在/etc/xinetd.d/rsync配置文件中。

 

16、rsync:recv_generator: mkdir"nfs01_172.16.1.31" (in backup) failed:Permission denied (13)

sendingincremental file list

./

rsync:failed to set times on"." (in backup): Operation not permitted (1)

nfs01_172.16.1.31/

rsync:recv_generator: mkdir"nfs01_172.16.1.31" (in backup) failed:Permission denied (13)

***Skipping any contents fromthis failed directory ***

sent 106bytes  received 15 bytes  80.67 bytes/sec

totalsize is 655  speedup is 5.41

rsyncerror: some files/attrs were not transferred (see previous errors) (code 23) atmain.c(1039) [sender=3.0.6]

錯誤原因:

1、服務端配置文件中指定的用戶和模塊指定的目錄的屬主屬組不同

2、服務端模塊指定的目錄屬組屬組沒有權限

解決方法:

將模塊指定目錄的屬主屬組修改為 配置文件中指定的 uid gid

[root@nfs01 ~]# chown rsync.rsync/backup           配置文件中指定的用戶和組

 

17、skippingnon-regular file “vendor/bin/doctrine”

receivingincremental file list

skippingnon-regular file “vendor/bin/doctrine”

skippingnon-regular file “vendor/bin/doctrine.php”

sent1990 bytes received 489209 bytes 327466.00 bytes/sec total size is 182515746speedup 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 bytes327518.00 bytes/sec total size is 182515746 speedup is 371.51

 

18、@ERROR: module is read only

sendingincremental file list

ERROR:module is read only

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

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

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

原因:

source源服務器端權限設置read為only只讀權限。

解決方法:

read only = false

19、password file must not be other-accessible

passwordfile must not be other-accessible

passwordfile must not be other-accessible

continuingwithout password file

Password:

原因:

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

解決方法:

chmod 600 rsyncd.pwd

 

20、rsync error: error starting client-server protocol

rsyncerror: error starting client-server protocol

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

原因:

/etc/rsyncd.conf配置文件內容有錯誤。請正確核對配置文件。

 

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

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

原因:

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

 

22、@ERROR: daemon security issue — contactadmin

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

原因:

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

23、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 服務,開啟服務。

 

 24、@ERROR: failed to openlock 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 即可解決


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM