[mythtv-users] mythbackend crashed, but live tv kept working

Steve Peters - Priority Electronics steve at priorityelectronics.com
Fri Nov 9 02:50:53 UTC 2007


-----Original Message-----
>From: mythtv-users-bounces at mythtv.org
[mailto:mythtv-users-bounces at mythtv.org] On Behalf Of >>Erik>
>Sent: Thursday, November 08, 2007 5:18 PM
>To: mythtv-users at mythtv.org
>Subject: [mythtv-users] mythbackend crashed, but live tv kept working


>I guess I'm not as lucky as you. When my backend crashes, I lose
everything.

>Would you mind posting that script? It's something that I would really like
to have.


Usually, when my backend crashes, nothing else works, but this is the first
time it's happened when live TV or any recording for that matter was being
watched. 

Here is my script. You will need to modify it a little for your own
computer, but it works nicely. I'm a rookie basher, so if anyone has any
ideas, feel free to send them. Also, this uses sendmail, so you have to have
a pop account somewhere (I think). I've changed all personal data from the
script to generic data, you'll get the idea. The script runs from a cron job
every 10 minutes.
-Steve

#!/bin/bash
#STEP 1: CHECK IF MYTHBACKEND IS RUNNING
ps -A | grep mythbackend > /home/steve/mythcheck.tmp
size=`stat -c %s /home/steve/mythcheck.tmp`
#mythcheck.tmp get's created above, and if mythbackend is not running, then
it has a file size of less than 10 bytes
#IF MYTHBACKEND IS DOWN, SEND EMAIL & SMS TO STEVE'S CELL
if [ "$size" -lt 10 ]
then
echo MythBackend is Down!!!
sendEmail -s mail.abcdefg.com -f user at abcdefg.com -t 2139999999 at vtext.com -u
MythBackend is Down -m MythBackend is Down -cc myemailaddress at abcdefg.com
-xu myemailaddress at abcdefg.com -xp myemailpassword
else
#IF MYTHBACKEND IS UP, SEND EMAIL TO STEVE at PRIORITYELECTRONICS.COM
echo MythBackend is Running
fi
#Delete the mythcheck.tmp temporary file
rm /home/steve/mythcheck.tmp
exit 0




More information about the mythtv-users mailing list