[mythtv-users] Remotely monitor Backend is running

Charles Schultz cschultz at cox.net
Tue Oct 12 18:02:12 UTC 2021


I run .31 in a Ubuntu VM on ESX server using one of the original HDHomeRun 2-tuner boxes.  For some reason, sometimes the list of upcoming recordings disappears.  The rules are still there, so I think it has something to do with communicating with the tuner device.  I have not spent much time in trying to figure it out because I spent 10 minutes on a workaround that’s “good enough for me”.  In case it helps, I created a cron job to run a curl command to check if there were recordings scheduled.  If not, it restarts the backend.

Crontab
29,59 * * * * /home/username/resetMyth.sh

Script
#!/bin/bash

SHOWS=$(curl -H "Accept: application/json" http://mythtv:6544/Dvr/GetUpcomingList 2> /dev/null | jq .ProgramList.Count | cut -d '"' -f 2)
if [ $SHOWS -eq 0 ]; then
	echo "Restarting Myth Backend"
	sudo systemctl restart mythtv-backend
fi

Regards,
Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20211012/402545e2/attachment.htm>


More information about the mythtv-users mailing list