rsyncでアイコンを保存する

rsyncでアイコンを保存する

私はここ他の調査によると、rsync はディレクトリとその内容を同期するために使用されるコマンドです。

次のコマンドを試しました:

rsync -avzr ~/testing123 ~/Desktop/apartment
sudo rsync -avzr ~/testing123 ~/Desktop/apartment

どちらもアイコンを保持せず、同じ結果を生成します。

sent 544 bytes  received 92 bytes  1272.00 bytes/sec
total size is 6148  speedup is 9.67
building file list ... done
created directory /Users/null/Desktop/apartment
testing123/
testing123/.DS_Store
testing123/Icon\#015
testing123/info.txt

sent 566 bytes  received 92 bytes  1316.00 bytes/sec
total size is 6166  speedup is 9.37

どちらもファイルを正しく同期しますが、元のファイルまたはディレクトリのアイコンは保持されません。ディレクトリの場合、フォルダーのアイコンを保持するのではなく、両方のコマンドは宛先ディレクトリに拡張子のない「Icon」という「0 KB」ファイルを作成します。ファイルの場合、何も行われず、謎の「Icon」ファイルも実際のアイコンもありません。

間違った引数を使用しているのが問題なのでしょうか? ここで何が問題なのでしょうか?rsync実際には、ソース ファイルと同じアイコンが宛先ファイルに作成されないのはなぜでしょうか?

答え1

-Eオプションを指定する必要がありますrsync

   -E, --extended-attributes
          Apple specific option  to  copy  extended  attributes,  resource
          forks,  and  ACLs.   Requires at least Mac OS X 10.4 or suitably
          patched rsync.

アイコンは HFS+ リソース フォークに保存されます。

関連情報