PDA

View Full Version : Running a command in Terminal from Automator?




JGruber
Jul 7, 2009, 09:57 AM
Ok, so on my OSX server, we have Python running at 100% CPU usage at random times, and to get it to stop, I'm forced to run a Terminal command.

I want to know if it is possible to use Automator to run said command in Terminal under root once a day at a given time, with no user input.

The command I am using is sudo killall -9 Python



angelwatt
Jul 7, 2009, 10:03 AM
You're probably better off scheduling it with cron (http://en.wikipedia.org/wiki/Cron).

rowsdower
Jul 7, 2009, 11:35 AM
cron is probably what you want, but if you really need to do it in Automator, you can create a shell script with your command in it and then use the "Run Shell Script" action.