rsync - 意外的遠端參數

rsync - 意外的遠端參數

我正在嘗試將資料夾從遠端同步到本地,但出現以下錯誤。我查看了很多線程,但找不到有效的解決方案。

kong@kong-P15SM:/media/kong/Elements$ rsync -r -i /home/kong/.ssh/id_rsantu --exclude=dataset/ [email protected]:~/sgan-original/ ./sgan-original/
Unexpected remote arg: [email protected]:~/sgan-original/
rsync error: syntax or usage error (code 1) at main.c(1348) [sender=3.1.1]

答案1

您似乎認為-i指定rsyncSSH 金鑰檔案的選項類似於ssh.事實並非如此。

-i, --itemize-changes 輸出所有更新的變更摘要

所以你的命令基本上是

rsync localdir user@host:remotedir localdir

如果您有多個來源(除了最後一個參數之外的所有來源),它們都必須是本地的。

編輯

你想用的可能是

rsync -r -e "ssh -i /home/kong/.ssh/id_rsantu" --exclude=dataset/ [email protected]:~/sgan-original/ ./sgan-original/

相關內容