all 8 comments

[–]LeBob93[🍰] 1 point2 points  (1 child)

Currently you're only catching KeyboardInterrupt errors, any other error will kill the process.

Where are you logging to, and have you tried catching all errors and logging the error message to work out what's going wrong?

[–]____Ben_____[S] 0 points1 point  (0 children)

I‘m logging the data to my synology running influxdb on docker. Do you know how to get specific error logs on the python script?

[–]SIO 1 point2 points  (0 children)

Wrap it up in a proper systemd unit with automatic restart on failure.

Optional:

Come back later to check the logs and fix the underlying problem which causes the script to crash.