I want to make a script that automatically backs up my kindle files when I connect it to my macbook pro. Writing the script is well within my ability, but I don’t know what’s the best way to run a script on mount automatically.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could either use AppleScript and attach a folder action to the
/Volumesdirectory, or you could write a Launch Agent that watches that path.For the latter, you can refer to Tutorial: Backups with Launchd on MacResearch. The gist of it is that you create a plist configuration file to be interpreted by
launchd; thenlaunchdwill execute your script when the specified path has changed.