I have finished a program in Python and I intend for it to be run from my RPi every n hours. This will be my first time running such program/script in this way and I would like to know if there is anything I should know/have written into the script before I add it to my crontab?
I'm also not sure how such an entry in the crontab would look. Do I write something like:
* 2 * * * pi `python /home/pi/Desktop/myProg.py`
With back-ticks around the command or would I launch myProg.py from within a shell script that I would call from the crontab?
* 2 * * * pi /home/pi/Desktop/launchMyProg.sh
Also, I had some print
statements in the program that I commented out as they were mainly for debug during writing it, but on second thoughts it would be useful for me to have these for debug info but directed to the /var/log/messages
or other log file which I can monitor with tail -f /var/log/messages
command.
How would I do that exactly? Thanks.