[SOLVED] Cron Job woes

I’m trying to set up a cronjob to measure the temperature of my pi and then report it to a DB by hitting a URL on another pi.

I’ve successfully set this up on a pure raspbian system but it seems to fail in OSMC.

The python script is:
import psutil, os, urllib2 res = os.popen('vcgencmd measure_temp').readline() CPUtemp = float(res.replace("temp=","").replace("'C\n","")) response = urllib2.urlopen('http://10.0.0.10/app/IntTemp/?temp='+str(CPUtemp)+'&sensor=temp').read() if response == "Error!": print "Error!"

The crontab is:
*/10 * * * * /usr/bin/python /home/osmc/temperature.py >/tmp/test.log 2>&1

The script runs and records in the DB outside of the cronjob, the python script also works outside of the cronjob. The /usr/bin/python /home/osmc/temperature.py section also works independently

What have I missed?

Is your crond running ? Can you see in logs it was run ?

In the logs:
Apr 05 17:30:01 osmc CRON[2009]: (osmc) CMD (/usr/bin/python /home/osmc/temperature.py >/tmp/test.log 2>&1) Apr 05 17:30:01 osmc CRON[2008]: pam_unix(cron:session): session closed for user osmc

Solved my own mistake, thanks for looking!

The vcgencmd needed to be the full path ie: /opt/vc/bin/vcgencmd