Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following python file called

import subprocess
   p = subprocess.Popen('growlnotify -m \"Program is not running\"', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 
   retval = p.wait()
   print "end"

it works fine from the command line with 'python' and `sudo python' (all it needs to do is display the growl notification)

I open up crontab with 'crontab -e' (i'm on OSX if that helps. I add the line

  • 8-23 * * * python /Users/xxx/Dropbox/scripts/ >> /Users/xx/running.txt

I expect the program to execute every minute from 8am to 23pm - and it does, the 'running.txt' file is filling up - but I'm not getting the growl notifications - any ideas?

share|improve this question
It might not be possible to execute growlnotify from there because growl is dependent on the graphical environment (and more?). Check your log files for errors. – ggustafsson Dec 28 '12 at 6:13
up vote 1 down vote accepted

The default path in crontab is /usr/bin:/bin. If you installed growlnotify somewhere else like /usr/local/bin/, you have to specify the full path in the script.

share|improve this answer
Yep - although it was the combination of this answer and the comment that got me there. – Joe Dec 28 '12 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .