Fully automated backup of Flash drives on mount

Mar 08, '07 07:30:00AM

Contributed by: jaguarcy

This was already submitted as a hint (Automated backup of flash drives), but that script wasn't quite what I needed. I have several small thumb drives which I'd like to back up, and some of them I don't need to maintain archives for; I only need a backup in case I lose the drive. Therefore I have modified the script a fair amount, and then using the hint to trigger backups on connect without launchd, create a modified version of Apple's backup script, which now enables me to do the following:

The folder action script scans the root of the mounted drive for the specific backup app, and executes it if found. This is a really pain-free way to maintain constant backups of all my critical work (that resides on thumb drives). And I'm fairly certain that the backup will be OK as the script is using the rsync UN*X command with instructions to mirror the drive contents, and tar -cz to do the archive (if required).

Additionally, I was experiencing some permission problems when using the original script because the .Trashes and .Spotlight folders weren't readable by the backup script. I circumvented this problem by having two options:
The modified scripts and full instructions are located here.

[robg adds: In case the above-linked post isn't available at some point in the future, I've mirrored the two scripts here on macosxhints.com...]

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070305140237616