1

I have the following python file called temp.py

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 temp.py' and `sudo python temp.py' (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/temp.py >> /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?

1
  • 1
    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. Commented Dec 28, 2012 at 6:13

1 Answer 1

1

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.

1
  • Yep - although it was the combination of this answer and the comment that got me there. Commented Dec 28, 2012 at 20:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.