1

I can't get cron to run my Python script. Below is my crontab entry:

0 22 * * * /usr/bin/python3.5 /home/gmoreno/hue.py > /tmp/log

Syslog shows the crontab run at set time but my Hue lights don't turn on. When I run the script manually the lights turn on.

7
  • I've tried /usr/bin/python instead of the /usr/bin/python3.5 and had the same result Commented Feb 16, 2017 at 6:44
  • Please post your error log and edit your question.
    – d a i s y
    Commented Feb 16, 2017 at 6:47
  • That's the thing I don't get an error in syslog and /tmp/log is empty. Commented Feb 16, 2017 at 6:50
  • 1
    edit your crontab with 0 22 * * * /usr/bin/python3.5 /home/gmoreno/hue.py >> /tmp/log 2>&1
    – d a i s y
    Commented Feb 16, 2017 at 6:55
  • Thanks Lnux I was able to figure out what the problem was with that. I had been scratching my head for hours on this. Commented Feb 16, 2017 at 7:09

1 Answer 1

-1

set path in crontab,

PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
0 22 * * * /usr/bin/python3.5 /home/gmoreno/hue.py

You must log in to answer this question.

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