OH 3 Temperatures of all Raspberry Pis in Network

Yes tried with leading /

Can you execute it from the command line:

/home…

Yes from the command line via python script name.py it works perfect. Could fetch it up with OH3

check the permissions as cron might be running as root

My crontab to run python script looks like this:
55 23 * * * /usr/bin/python3 /data/scripts/tools/send_data.py >/dev/null 2>&1

It is scheduled with sudo crontab -e

Maybe obvious but please check if you script starts with
#!/usr/bin/python3 or #!/usr/bin/python

I also had some problems with cron task scheduling and cheking logs was helpful
grep CRON /var/log/syslog

Hallo,

die syslog zeigt:

 Jan 22 18:33:01 raspberrypi **CRON**[15268]: (**CRON**) info (No MTA installed, discarding output)

Jan 22 18:34:01 raspberrypi **CRON**[15275]: (pi) CMD (home/pi/measurecputemp.py 2>&1 >> /home/pi/wetterstation.log)

Jan 22 18:34:01 raspberrypi **CRON**[15274]: (**CRON**) info (No MTA installed, discarding output)

Jan 22 18:35:01 raspberrypi **CRON**[15290]: (pi) CMD (home/pi/measurecputemp.py 2>&1 >> /home/pi/wetterstation.log)

Jan 22 18:35:01 raspberrypi **CRON**[15289]: (**CRON**) info (No MTA installed, discarding output)

Jan 22 18:36:01 raspberrypi **CRON**[15294]: (pi) CMD (home/pi/measurecputemp.py 2>&1 >> /home/pi/wetterstation.log)

Jan 22 18:36:01 raspberrypi **CRON**[15293]: (**CRON**) info (No MTA installed, discarding output)

Jan 22 18:37:01 raspberrypi **CRON**[15297]: (pi) CMD (home/pi/measurecputemp.py 2>&1 >> /home/pi/wetterstation.log)

Jan 22 18:37:01 raspberrypi **CRON**[15296]: (**CRON**) info (No MTA installed, discarding output)

Jan 22 18:38:01 raspberrypi **CRON**[15542]: (pi) CMD (home/pi/measurecputemp.py 2>&1 >> /home/pi/wetterstation.log)

Jan 22 18:38:01 raspberrypi **CRON**[15541]: (**CRON**) info (No MTA installed, discarding output)

Jan 22 18:39:01 raspberrypi **CRON**[15591]: (pi) CMD (home/pi/measurecputemp.py 2>&1 >> /home/pi/wetterstation.log)

Jan 22 18:39:01 raspberrypi **CRON**[15590]: (**CRON**) info (No MTA installed, discarding output)

Try to run it in cron as:
home/pi/measurecputemp.py >> /home/pi/wetterstation.log 2>&1
and check what appears in /home/pi/wetterstation.log

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/pi/measurecputemp.py: not found

/bin/sh: 1: home/measurecputemp.py: not found

/bin/sh: 1: home/measurecputemp.py: not found

/bin/sh: 1: measurecputemp.py: not found

seems that you try run Python script as shell and also is not possible to find your script because of missing / at the beginning (it could be because of my mistake above :thinking:)

try run it as this:
0/1 * * * * /usr/bin/python /home/pi/measurecputemp.py >> /home/pi/wetterstation.log 2>&1

and be sure that 1st line in your scripts is:
#!/usr/bin/python

Now I changed 0/1 to * and it´s working :slight_smile:

THANK YOUUUU

1 Like