Start Python script with cron


I’m using v6.21.1 on a RPi Zero W and it works well.

For my installed FHEM I created a Python script in:


To start this script hourly with cron I created a file in:

-rwxr-xr-x  1 root root  132 Mar 13 13:38 fhem-dht

with the following code:

# read dht11 values every 5mins and feed into fhem

# m h dom mon dow usercommand

In dietpi-cron the value for hourly is set on 17 and I thought that will start this script every hour at the 17. minutes. But nothing happens. I can start both scripts on the console manually with dietpi and root user and it works.

Where is my mistake?


I think cron does not identify the file as executable shell script as 1st line is no valid shebang. Please try with: