I would like to implement an automatic rsync backup to my USB stick drive whenever it's first inserted and then only once.
I can do rsync just fine from the command line, of course, but I'd like to just stick the pen drive in and have the backup run automagically, then I can decide if I want to copy other files too.
I wonder if there's a way to recieve a notification when a drive is mounted, or if there's a hook that gets executed when /Volumes/SECURE (my USB pen drive partition that I backup to) is first mounted?
I'm fairly familiar with linux, but not so much with Darwin.
Thanks for the help?
There is a freeware utility, Do Something When 1.1 which can be programmed to perform an action when a drive mounts (or dismounts.) You can use it to run a script or other application. Sounds like it may be what you are looking for.
This also may be something suited for Automator? It should also be doable through an AppleScript.