anyone ever set up rsync or other terminal scripts

Posted by: newkojak

anyone ever set up rsync or other terminal scripts - 03/05/08 09:02 AM

I have a command that I like to run in the terminal. It takes the contents of my school folder and synchronizes the changes with the same folder on a flash drive.<br><br>Is there any lightweight way that I can script the finder so that when I insert a flash drive, it automatically runs a command?<br><br>-- Cee Bee Double-U
Posted by: Rodrigo Haenggi

Re: anyone ever set up rsync or other terminal scripts - 11/25/08 02:02 PM

The first thing that comes to my mind would be a custom launchd daemon.

Posted by: zwei

Re: anyone ever set up rsync or other terminal scr - 12/01/08 11:53 AM

look into an app called "Lingon" if you want to start messing around with launchd ..it's great.

While you can do stuff via launchd when volumes are mounted ...you might want to wrap the terminal command into an applescript that looks to see what volume was mounted. Otherwise it will run when ANY volume is mounted.

This is how you would write the script...
Code:
set theVolumeName to "YourFlashDriveNameHERE"

tell application "Finder"
	if disk theVolumeName exists then
		do shell script "ENTER YOUR TERMINAL COMMAND HERE"
	end if
end tell