WeeWX is designed to recover from hardware issues. Now, if the operating system crashes, there isn't much you can do about that. But, your restart script isn't going to help that either.
Please pass on the system log of any WeeWX crash. On Sat, Feb 23, 2019 at 12:57 PM Mark Jenks <[email protected]> wrote: > It doesn't do it often, but I think it had a hardware issue with the usb. > It could be the OS that I'm on also.. > > Better > > On Saturday, February 23, 2019 at 10:00:49 AM UTC-6, Thomas Keffer wrote: >> >> Mark, >> >> WeeWX should not crash. If it does, it's a bug. I have successfully run >> it for 2 years at a time. >> >> The next time it does, please post the system log. Far better to engineer >> out the point of failure. >> >> -tk >> >> On Sat, Feb 23, 2019 at 7:36 AM Mark Jenks <[email protected]> wrote: >> >>> I've been running this for a few years now, and once and awhile weewx >>> just falls over for no good reason. To deal with this, I wrote a script >>> that I run in cron to check to make sure it's running, and if not, start it >>> over again. >>> >>> Here it is for everyone to use.... >>> >>> -Mark >>> >>> [root@server bin]# crontab -l >>> 0 * * * * /usr/local/bin/watch-weewx.sh >>> >>> >>> [root@server bin]# cat watch-weewx.sh >>> #!/bin/bash >>> service=weewx.service >>> if (( $(/usr/bin/systemctl status $service | grep running | wc -l) < 1 )) >>> then >>> echo “$service was down and was restarted!!!” >>> systemctl stop $service >>> systemctl start $service >>> fi >>> if (( $(/usr/bin/systemctl status $service | grep "Exiting..." | wc -l) >>> > 0 )) >>> then >>> echo “$service Exited and was restarted!!!” >>> systemctl stop $service >>> systemctl start $service >>> fi >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "weewx-user" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
