Skip to Content

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 applications that trigger a backup when you connect 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 application or document when a drive is mounted! Why, with that plus SuperDuper!, or Automator, or even rsync/rsnapshot and Platypus -- you'd be a backup machine.

So, the way to trigger backups on mount can be summed up thusly:
  1. Create your backup script in your tool of choice and save as a document or applet.
  2. Trigger that script when your drive is mounted, using DSW.
  3. There is no step three. There's no step 3!
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 connect 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 backups (rsnapshot, Chronosync, EMC Retrospect).

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

[via MacOSXHints]

Categories

Cool tools TUAW Tips

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...
 

Add a Comment

*0 / 3000 Character Maximum

7 Comments

Filter by:
Marc

Where can I get a copy of the SuperDuper Backup Script?

Thanks so much!

January 18 2007 at 1:47 PM Report abuse rate up rate down Reply
ross

how i do it is:

I have a powermac upstairs with a shared drive. A macbook pro downstairs connected via wireless. on boot the shared drive mounts. I have two scripts written - one which backups important files i.e. Pictures and Documents folder, and a second script which is a restore script. Both scripts were created through Automater

Very handy...

January 12 2007 at 10:52 AM Report abuse rate up rate down Reply
alangenh

So far I've just used Apple's suggested way, Folder Actions, to lauch what I want when a drive is mounted...

http://www.apple.com/applescript/folderactions/05.html

(example 2)

January 12 2007 at 9:58 AM Report abuse rate up rate down Reply
Michael Rose

Pete: Most home users would go with hard drives, DVD or flash. You can use tape drives on the Mac, but there are relatively few that connect via FireWire (LaCie used to sell one, not sure they still do).

#2: SuperDuper! creates reliable, bootable backups; the 'ditto' command should as well, and EMC Retrospect usually does. For other utilities your mileage may vary.

Greg: EXCELLENT point about accidental overwrites of your backup data, I shall amend the post.

January 12 2007 at 9:40 AM Report abuse rate up rate down Reply
Greg

I thought this was a great idea. Until I remembered that the last time I connected my backup drive was to retrieve a file I had edited badly and needed to return to the earlier version. If my backup started automatically it would have replaced the file I was looking for with the newly wrecked file.

January 12 2007 at 8:44 AM Report abuse rate up rate down Reply
WinnetouKoslowski

All this automatism seems so neat, but what happens, when you have to boot from your Backupdrive? I don’t trust any of this.

January 12 2007 at 8:04 AM Report abuse rate up rate down Reply
Pete

What do people normally backup to? I use another hard drive, can you get tape drives for macs?

January 12 2007 at 7:35 AM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.