On Raspbian, I created a crontab file using the following command:
sudo crontab -e Added the following lines to cron
@reboot /usr/bin/python3 /home/pi/dev/bootscripts/ipchecker/ipchecker.py
0 * * * * /usr/bin/python3 /home/pi/dev/bootscripts/ipchecker/ipchecker.py
I tested my script and it does the work successfully when run via command-line:
python3 /home/pi/dev/bootscripts/ipchecker/ipchecker.py
OR
/usr/bin/python3 /home/pi/dev/bootscripts/ipchecker/ipchecker.py
So with my cron jobs I would expect to get the python script running on every reboot and every hour, but seems not. What could be wrong here, and how can one debug what's going on silently on cron jobs? Should I check in the Logs?
journalctl
for cron outputs and try adding a simple logging of your own (e.g. write to file) to the python script itself. That should get you at least started. – Ghanima♦ Jul 26 '16 at 7:29