You really should get to the bottom of why weewx is dying.  Logs are your 
friend.

I don’t have a watchdog for weewx, but I have such jobs for other software.  
Here’s a simplified script that should do the job.  If you have mail set up, 
you should add a line to mail you that weewx had to be restarted.  Also, 
replace ‘/home/weewx/bin/weewxd’ with the location of your weewxd.   Assuming 
weewx is running a root, you’ll need to add the cron entry for root.

#!/bin/sh
# If we just started up, allow some time for the process to start.
if [ `cat /proc/uptime | cut -f1 -d '.'` -le  30 ]; then
  sleep 20
fi
ps aux | grep "/home/weewx/bin/weewxd" | grep -v grep > /dev/null
if [ $? -ne 0 ]; then
        /usr/shin/service weewx restart
fi

> On Apr 18, 2022, at 9:12 PM, [email protected] <[email protected]> wrote:
> 
> Has someone worked out a cron job that will periodically check to see that 
> weewx is running and issue a restart if it is not?
> I have been getting notified (email) about once per week letting me know that 
> weewx stopped sending data.
> 
>> On Thursday, November 25, 2021 at 12:57:32 PM UTC-8 Clyde wrote:
>> I'm running weewx 4.5.1 with a Belchertown skin on a Raspberry pi. All was 
>> working fine, but recently the service randomly stops. There is nothing in 
>> the /var/log/messages other than normal reports. Restarting the service 
>> (`service weewx restart`) resumes normal operation until the next time. The 
>> failures are happening maybe once a week, but not on any regular schedule.
>> 
>> Any ideas on how to troubleshoot this?
> 
> -- 
> 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].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/9b174589-69e8-4937-a9e2-8eb79de8a024n%40googlegroups.com.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/EF481611-C62C-44AA-895A-12DEBA96A84F%40johnkline.com.

Reply via email to