I have a simple problem that I cannot seem to find an answer to even though I have done some research. I am trying to run a python script via crontab (I have never worked with crontab before this haha). Currently, this is what I have in my crontab -e
*/2 * * * * /home/pi/path_to_script/fileName.py
I want the script to be run every 2 minutes. The script 'fileName.py' writes to a text file so I know whether the crontab has run the script or not: the text file is never changed. I also have some print()
lines in the script and those messages are never outputted. Furthermore, the first line in fileName.py is
#!/usr/bin/python3
So I believe I got the shebang directory down. I also tried the following in the crontab -e
*/2 * * * * /usr/bin/python3 /home/pi/path_to_script/fileName.py
and that does not seem to work. Also I have complied fileName.py with chmod +x so the script runs when I type ./fileName.py in the command line.
Any ideas as to why the crontab does not execute?
Thanks