1. 程式人生 > >Rsync服務器搭建遇到的報錯解決辦法

Rsync服務器搭建遇到的報錯解決辦法

Rsync報錯 linux centOS

遇到錯誤1

[root@backup tmp]# rsync -avz /etc/hosts -e 'ssh -p 22' [email protected]:/tmp/

rsync: Failed to exec ssh: No such file or directory (2)

rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.6]

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

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

從網上找打解決方法講是沒有安裝openssh客戶端,然後安裝嘗試一下

[root@backup tmp]# yum -y install openssh-clients.x86_64

安裝完成之後有執行一次,發現錯誤提示變了,說明剛才那個錯誤已解決然後開始解決新的報錯問題

從本地服務器上推送文件到172.16.1.5這臺服務器上,發現一直提示這個錯誤信息。然後在網上找各種解決方法,最終得以解決。

[root@backup tmp]# rsync -avz /tmp/hosts -e 'ssh -p 22' [email protected]:/tmp/

[email protected]'s password:

bash: rsync: command not found

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

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

造成這種原因是因為172.16.1.5這臺服務上沒有安裝rsync這個軟件包,安裝後得以解決

[root@backup tmp]# rsync -avz /tmp/hosts -e 'ssh -p 22' [email protected]:/tmp/

[email protected]'s password:

sending incremental file list

hosts

sent 124 bytes received 31 bytes 62.00 bytes/sec

total size is 158 speedup is 1.02

[root@lb01 tmp]# ifconfig eth1| awk -F "[ :]+" 'NR==2 {print $4}'

172.16.1.5

[root@lb01 tmp]# ls /tmp/

hosts

對端沒有配置文件裏面的目錄不存在

[root@nfs01 sh]# rsync -avz /backup/ [email protected]::backup/ --password-file\=/etc/rsync.password

@ERROR: chdir failed

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

對端配置文件裏面的目錄存在,但是權限被拒絕

[root@nfs01 sh]# rsync -avz /backup/ [email protected]::backup/ --password-file\=/etc/rsync.password

sending incremental file list

./

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

1/

rsync: recv_generator: mkdir "1" (in backup) failed: Permission denied (13)

*** Skipping any contents from this failed directory ***

sent 46 bytes received 15 bytes 122.00 bytes/sec

total size is 0 speedup is 0.00

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]

模塊名稱錯誤

[root@nfs01 sh]# rsync -avz /backup/ [email protected]::baskup/ --password-file\=/etc/rsync.password

@ERROR: Unknown module 'baskup'

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

服務端虛擬用戶不存在

[root@nfs01 sh]# rsync -az /backup/ [email protected]::backup/ --password-file\=/etc/rsync.password

@ERROR: invalid uid rsync

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

服務端沒有backup模塊裏面的密碼文件,客戶端和服務端的密碼文件密碼不一致

[root@nfs01 sh]# rsync -az /backup/ [email protected]::backup/ --password-file\=/etc/rsync.password

@ERROR: auth failed on module backup

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

在傳輸的時候遠程模塊名稱前面多寫了一個“/

[root@nfs01 /]# rsync -avz /tmp/ [email protected]::/backup/ --password-file\=/etc/rsync.password

ERROR: The remote path must start with a module name not a / #遠程路徑必須是模塊名稱

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


Rsync服務器搭建遇到的報錯解決辦法