Thagrol's guide covers how to debug cron entries. I suggest you read it as it gives a lot of good advice.Well. I also tried it without sudo. And when you say find the error...how do I do that? Everything looks right to me. Thats why I came here for help.
The usual starting point is to add some logging to your entry (and remove that "&" on the end, it isn't needed in cron.
Change this
Code:
* * * * * /usr/bin/python3 /home/pi/gardenpi/test.py &Code:
* * * * * /usr/bin/python3 /home/pi/gardenpi/test.py >>/home/pi/gardenpi/test.log 2>&1To explain what I did:
The ">>" means "redirect any standard output messages to append to the filename that follows this.
The "2>&1" means write any error output (2) messages to the same filename as standard messages (1). "2" is the file handle of the error output STDERR, "1" is the file handle of normal output STDOUT (the default). "0" is the file handle of normal input STDIN.
Statistics: Posted by rpdom — Fri May 16, 2025 7:02 am