Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6268

Python • Re: Raspberry Pi Scripts stops running after a while.

$
0
0
Any ideas? - Thanks

System log files won't show anything for processes started by cron. Unless specifically redirected all their output and error messages are discarded.

[shameless self promotion]
Cron – A Beginner's Guide Especially section 6
For alternatives to cron see Running A Program At Start Up A Beginner's Guide
[/shameless self promotion]

If a reading once a minute is acceptable you may wish to convert your script from a loop with a 30 second sleep (don't forget a fixed duration sleep will actually have an interval of "time it takes to do stuff" + 30 seconds so readings will not be every 30 seconds) to a one shot with no loop and call it once a minute from cron.

If you opt for a systemd service instead of cron it can be configured to restart a failed service automatically.

Statistics: Posted by thagrol — Tue Apr 29, 2025 7:09 pm



Viewing all articles
Browse latest Browse all 6268

Trending Articles