2004 Dec 14
HOW TO QUICKLY CREATE AND USE ARCHIVES
With UNIX utilities GZIP, TAR, ZCAT (on Mac OS X)?

Note: Windows users can also read/use these files (just not using these commands). If you don't have a utility on Windows for tar or gzip content 7-Zip is available free from http://sourceforge.net/projects/sevenzip/


To create a backup of all PSD files:

1 in the Terminal navigate to the top-level working directory (on the Mac '/Volumes/' is the starting point for all external media, CD's, memory-sticks, external HD, network drives, etc):
cd /Volumes/PROJECTS/CoName/2426_ProjName/design/comps/flight1/round1

2 use the following command(s) to find all psd files and create a new compressed archive with the same (change the file name, ProjNamePSD0.tar.gz, as desired):
tar -cvf - `find . -iname "*.psd" -print | grep -i '.*\/\w*\.psd$'` | gzip -9 > _backups/ProjNamePSD0.tar.gz

in multiple steps this is:
tar -cvf _backups/ProjNamePSD0.tar `find . -iname "*.psd" -print | grep -i '.*\/\w*\.psd$'`
gzip -9 _backups/ProjNamePSD0.tar

To restore ALL files in an existing archive:

1 in the Terminal navigate to the top-level working directory and issue this command (be sure to change the filename--here 'ProjNamePSD0.tar.gz and then ProjNamePSD0.tar--to the desired backup):
cd /Volumes/PROJECTS/CoName/2426_ProjName/design/comps/flight1/round1

2 use the following command(s) to expand and unpack (restore) all files:
zcat _backups/ProjNamePSD0.tar.gz | tar -xvf -

in multiple steps this is:
tar -cvf _backups/ProjNamePSD0.tar.gz
gunzip -9 _backups/ProjNamePSD0.tar

To restore SELECTED files from an existing archive:

1 recommend copying the archive to your desktop and expanding it on your desktop using similar commands, or a gui utility like Stuffit Expander, or 7-Zip* for Windows.

2 select the desired files and move them to the target location.