Scripts Part 6: Archiver
A hint on MacOSXHints yesterday discussed using tar to create backups in Mac OS X. The poster was frustrated with the OS X-bundled version of the zip command, and confused by the way the Finder creates .zip files. Indeed, the Finder does not use the zip command to create its .zip files, and indeed it is confusing. And, more importantly, the zip command does not preserve all-impotant Mac OS X resource forks.
After reading this hint I was reminded of a script I wrote a while back based on yet another MacOSXHints hint that uses ditto to create Finder-like .zip archives. So it seemed like a good time to post the script here and add it to the waning ScriptSharing series.
So here it is: my Archive script. It will both archive and expand folders or files using ditto, and it places these archives on the Desktop.
Archiver Script
See the code
After reading this hint I was reminded of a script I wrote a while back based on yet another MacOSXHints hint that uses ditto to create Finder-like .zip archives. So it seemed like a good time to post the script here and add it to the waning ScriptSharing series.
So here it is: my Archive script. It will both archive and expand folders or files using ditto, and it places these archives on the Desktop.
Archiver Script
See the code
Labels: Scripts, ScriptSharing
Cool script. And it's always important to be mindful of what binaries copy what info with your files (dan shoop covers this on his site and in a recent MacTech article: "Do You Copy?", https://iwiring.net/papers/DoYouCopy.pdf).
I use ditto for all kinds of backups. But I don't zip them. I used to use rsync a lot. Personally, at home, I either burn a few DVDs, or clone off my drive every week or so.
4:06 PM
I use ditto for general file copying in Mac OS X, mainly 'cause I've been using it forever and I know it works. I actually never really use the script I provided — I just use the Finder to make .zips in most cases — but it's nice to have around.
For big data backups — particularly staff backups at work — I use rsync, mainly for its network abilities. I DO NOT use the bundled Tiger rsync command, however, as I've had tons of problems with it. Instead I use rsyncx, which has always worked quite well for my needs, and which preserves resource forks.
Personally, I'm like you when it comes to my own backups. I just burn some DVDs when the drive starts getting full. Though I have started keeping a backup of my Work drive on a separate hard drive, which I backup to periodically with rysncx.
Hmmm... Maybe it's time to write a post on rsync backups. That might be fun...
-systemsboy
4:07 PM
Oh, meant to mention, read that article. Very informative. Thanks!
-systemsboy
» Post a Comment