User avatar
Paeryn
Posts: 2966
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: crontab does not work?

Mon Oct 23, 2017 9:23 pm

rpiuser2016 wrote:
Mon Oct 23, 2017 8:27 pm
crontab -e
*/15 * * * * python /home/pi/DHT22-TemperatureLogger/DHT22logger.py
-----
does not start automatically after reboot pi2b
How long did you wait? */15 will only trigger when the minutes is 0, 15, 30 & 45 so if you booted up at 1 minute past you will have to wait 14 minutes (I don't think it guarantees how many seconds into a minute it will trigger). Also, if that is the last line of your crontab you need to make sure there is a newline at the end, if not cron won't run it.

Redirect stdout and stderr to a file so you can see what errors your code is giving you.

Code: Select all

*/15 * * * * python /home/pi/DHT22-TemperatureLogger/DHT22logger.py > /home/pi/dth22-outout 2>&1
She who travels light — forgot something.

rpiuser2016
Posts: 78
Joined: Tue Jan 12, 2016 1:53 pm

Re: crontab does not work?

Wed Nov 01, 2017 2:02 pm

Code: Select all

*/5 * * * * python /home/pi/DHT22-TemperatureLogger/DHT22logger.py > /home/pi/dth22-outout 2>&1
Works fine, I need more time to wait :D

Return to “General programming discussion”