我已登入 Synology NAS,雖然我可以從伺服器到 NAS 進行 rsync,反之亦然,但當來源和目標均位於 DiskStation 上時,我無法使用 rsync。
midnight my_user /tmp> rsync -Pauvvv synoproxy.conf del.del
sending incremental file list
[sender] make_file(synoproxy.conf,*,0)
send_file_list done
send_files starting
server_recv(2) starting pid=15513
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(1034) [Receiver=3.0.8]
[Receiver] _exit_cleanup(code=1, file=main.c, line=1034): about to call exit(1)
rsync error: rsync service is no running (code 43) at io.c(653) [sender=3.0.8]
[sender] _exit_cleanup(code=43, file=io.c, line=653): about to call exit(43)
midnight my_user /tmp>
我不知道為什麼我提供的語法有模組問題。為什麼這會產生錯誤?
答案1
看來必須使用絕對目錄,例如 /volume1/homes/username/...
答案2
恢復此線程後,我在更新版本的 Synology NAS 上偶然發現了相同的問題。 Synology 似乎運行 rsync 守護程序,因此語法與常規路徑不同。
首先你可以
nmap -p 873 --script rsync-list-modules <NAS_IP>
取得 rsync 守護程式所知道的 rsync 模組清單。據我了解,這些名稱是 NAS 中根資料夾的名稱。
然後代替
rsync /path/to/src user@IP:/path/to/dst
使用
rsync /path/to/src user@IP::modulename/path/in/module
也可能有許可問題,但我認為這至少是問題的一部分。
答案3
下列的https://serverfault.com/a/454876/589058,我在 Synology 伺服器上解決此問題的方法是:
1) download rsync-x86 from https://github.com/JBBgameich/rsync-static/releases;
2) scp /path/to/local/rsync-x86 my_server:/tmp/;
3) ssh my_server;
4) chmod +x /tmp/rsync-x86;
5) exit;
6) rsync -avzPh --rsync-path=/tmp/rsync-x86 source dest;
答案4
從我讀到的內容來看Synology 論壇主題,我會嘗試更新韌體和您的 NAS 設備,看看是否可以解決問題。或許還有這個帖子很有趣。