Sunday, 3 December 2006

TUAW Tip: The easy way to backup on mount


Sometimes you have to suffer through the hard way once or twice just to find out... there's an easier way. I've posted recently about commercial backup a licatio that trigger a backup when you co ect a target drive; I've posted on roll-your-own scripts that do the same thing. Over at MacOSXHints, an enterprising soul took the scripts from post #2 and enhanced/extended them. Great effort, everyone!

Then, along comes a comment to the scripting hint: "Hey, why not just use Do Something When?" Gosh, never heard of that, let's check it out... gadzooks! A preference pane that launches an a lication or document when a drive is mounted! Why, with that plus SuperDuper!, or Automator, or even rsync/r a hot and Platypus -- you'd be a backup machine.

So, the way to trigger backu on mount can be summed up thusly:
  1. Create your backup script in your tool of choice and save as a document or a let.
  2. Trigger that script when your drive is mounted, using DSW.
  3. There is no step three. There's no step 3!
< an style="font-style: italic;">See additional notes and caveats after the jump.

Update: As Greg points out in his comment, with any scheduled or triggered clone to a drive, there's the risk of accidentally overwriting your 'good' data if you co ect the backup device to recover a file. Be sure to: disable the DSW pane before recovery; hook up your drive to a different machine; use a backup tool that requires a confirmation click (SuperDuper!), or one that does incremental/historical backu (r a hot, Chronosync, EMC Retro ect).

Also, Amy's comment points to a Mothership-sanctioned a roach: an A leScript Folder Action to launch when a drive is mounted. Again, the cautio from Greg a ly: you run the risk of accidentally overwriting your backup using any auto-launch method, so be careful out there.

[via MacOSXHints]

No comments: