I am new to Linux and experimenting with scheduling a task on a Raspberry Pi B. I can not get the scheduled task to run nor do I see the scheduled task when I use crontab -l
. When I run crontab -l
I get the message no crontab for pi.
I have opened cron using the command
sudo crontab -e
I want to schedule a python script to run every minute so I have this line in the crontab file:
* * * * * /home/pi/range_sensor.py
My python file's first line contains #!/usr/bin/env python
and I have used
chmod +x /home/pi/range_sensor.py
to change the execute permissions. Why is my scheduled task not running every minute? Where did I go wrong?
* * * * * pi "python /home/pi/range_sensor.py"
in the case of it should be launched as "pi" user. Did you restarted the daemon after doing changes?