rsync 資料備份常見錯誤
阿新 • • 發佈:2020-08-12
rsync 備份報錯總結
1)密碼檔案不能被其他人訪問
[root@web01 ~]# rsync -avz ./dir [email protected]::backup --password-file=/etc/rsyncd.passwd ERROR: password file must not be other-accessible rsync error: syntax or usage error (code 1) at authenticate.c(196) [sender=3.1.2] 解決:給密碼檔案賦予許可權(rsync在上傳檔案的時候是以當前使用者的許可權執行檔案的相關操作) [root@web01 ~]# chmod 600 /etc/rsyncd.passwd
2)上傳失敗 上傳的檔案不存在
[root@web01 ~]# rsync -avz ./dir [email protected]::backup --password-file=/etc/rsyncd.passwd sending incremental file list rsync: link_stat "/root/dir" failed: No such file or directory (2) sent 22 bytes received 20 bytes 84.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(1179) [sender=3.1.2] 解決: 檢查上傳的檔案是否存在 檔名是否寫錯
3) 連結超時 連結地址失敗
[root@web01 ~]# rsync -avz ./dir15 [email protected]::backup --password-file=/etc/rsyncd.passwd rsync: failed to connect to 172.16.1.41 (172.16.1.41): Connection timed out (110) rsync error: error in socket IO (code 10) at clientserver.c(125) [sender=3.1.2] # 解決 首先ping下網址否能通 地址是否寫對
4)連結失敗 沒有路由訪問到主機
[root@web01 ~]# rsync -avz ./dir15 [email protected]::backup --password-file=/etc/rsyncd.passwd
rsync: failed to connect to 172.16.1.41 (172.16.1.41): No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(125) [sender=3.1.2]
# 解決 由於服務端的防火牆沒有關和安全策略組 導致客服端連結不上路由訪問服務端
[root@backup ~]# vim /etc/selinux/config SELINUX enforcing 改成 SELINUX disabled
[root@backup ~]# systemctl stop firewalld
[root@backup ~]# source /etc/selinux/config