SSHによるRsyncの除外

SSHによるRsyncの除外

SSHを介してリモートホストのコンテンツを自分のラップトップに同期したいと思います。
一部のファイルを除外したいのですが、リモートホストに除外する項目を指定する「.rsyncexclude」というファイルがあります。

だから、次のコマンドを実行します。

rsync -av --progress --delete --exclude-from='[email protected]:remote/path/to/folder/to/sync/.rsyncignore' --delete-excluded [email protected]:remote/path/to/folder/to/sync/ local/path/to/folder/to/sync/

ただし、次のエラーが発生します。

rsync: failed to open exclude file [email protected]:remote/path/to/folder/to/sync/.rsyncignore: No such file or directory (2)

私は何が間違っていましたか?

ベストアンサー1

この--exclude-fromオプションは、ローカルrsyncプロセスが除外リストに追加するために読み取る必要があるファイルを指定します。リモートホストからファイルを読み取るために使用される表記法はサポートされていません。ファイル名をローカルファイルへのパスとして解釈するため、ファイルを開こうとするとエラーが発生します。failed to open exclude file [email protected]:remote/path/to/folder/to/sync/.rsyncignore

.rsyncignoreまず、ファイルをlocalhostに転送してから、optionsを介してそのファイルを参照する以外に、必要なことを行う方法はないと思います--exclude-from

-Fソース側から読み取る各ディレクトリファイルを指定するこのオプションを使用すると便利です。.rsync-filter

おすすめ記事