OS Xのアプリケーション、システムフォルダに存在するアイコンや画像のリソースファイルを全て集められるスクリプトを使ってみました。詳細は以下から。

OS Xのアプリケーションやシステムなどには様々なアイコンや画像のリソースファイルが使用されており、Keynoteやブログなどで使用している方も多いと思いますが、これらのファイルを一括で集めてくれるスクリプトを探していたところrtroutonさんのGitHubに公開されていたので使用してみました。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create a /tmp/icons.XXXX directory to | |
# store the copied images and icon files | |
TMPDIR=`/usr/bin/mktemp -d /tmp/icons.XXXX` | |
# The function below uses the image file | |
# format specified by the "filetype" variable | |
# to copy the relevant image and icon files | |
# from /Applications and /System/Library | |
GetIcons () { | |
mkdir "$TMPDIR"/"$filetype" | |
mkdir "$TMPDIR"/"$filetype"/Applications | |
mkdir "$TMPDIR"/"$filetype"/System | |
echo "Copying $filetype files to $TMPDIR/$filetype" | |
find /Applications 2>/dev/null -iname "*.$filetype" -type f -print0 | xargs -0 -I '{}' cp "{}" $TMPDIR/$filetype/Applications 2>/dev/null | |
find /System/Library 2>/dev/null -iname "*.$filetype" -type f -print0 | xargs -0 -I '{}' cp "{}" $TMPDIR/$filetype/System 2>/dev/null | |
} | |
filetype="icns" | |
GetIcons | |
filetype="png" | |
GetIcons | |
filetype="pdf" | |
GetIcons | |
echo "All finished! Copied images and icon files are available in $TMPDIR" |
これはファイルタイプがicns, png, pdfのリソースファイルを”/Applications” および “/System/Library”からコピーしてくれるスクリプトで、スクリプトをcloneして実行権を与え実行すると”/tmp/icons.XXXX”ディレクトリに全てコピーしてくれます。

あまり使用していない状態のOS X 10.10 Yosemiteで実行したところ合計ファイルサイズ 約1.3GB、ファイル数 約2万程のファイルがコピーされたので、資料作成などに必要な方は使ってみてください。

関連リンク:
- rtrouton/rtrouton_scripts – GitHub
コメント
crontabとこんなスクリプトを使って、サーバー上の毎週7日以内に作られたファイルだけをバックアップとかしてる。
正確に言うと月一のフルバックアップと毎週の差分バックアップだな。