リモートからローカルにフォルダーを 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
のオプションは のように SSH キー ファイルを指定するものだ-i
と考えているようですが、そうではありません。rsync
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/