<div dir="ltr">On Fri, Jul 22, 2016 at 6:03 AM Mark Perkins <<a href="mailto:perkins1724@hotmail.com">perkins1724@hotmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Does anyone have a simple script that they would be willing to share that<br>
fires off an email whenever there is failed recording?<br>
<br>
I am getting a tuner that drops out about once every couple of months - and<br>
if I am not watching a lot of shows at the time it can be a few days before<br>
I realise it.<br></blockquote><div><br></div><div>Recent version of Myth can fire off a "system event" if the detect that a recording is 'in the process' of failing.  For example, you can configure the "Recording failing" event with:<br><br></div><div>`/usr/local/bin/email_failure.sh "%CARDID%" "%CHANID%" "%STARTTIMEISOUTC%" "%ENDTIMEISOUTC%" "%TITLE%" "%SUBTITLE%" "%DESCRIPTION%"`<br><br></div><div>and then have the following in /usr/local/bin/email_failure.sh:<br></div><div><br>```<br> #! /bin/bash<br><br>cardid=$1<br>chanid=$2<br>starttime=$3<br>endtime=$4<br>title=$5<br>subtitle=$6<br>description=$7<br><br>recipients="<some email address>"<br>from="<some email address>"<br>subject="Recording failing"<br>message="The following recording did not start on time."<br><br>/usr/sbin/sendmail "$recipients" <<EOF<br>Subject:$subject<br>From:$from<br>To: <your email address><br>$message<br><br>cardid:    $cardid<br>chanid:    $chanid<br>starttime: $starttime<br>endtime:   $endtime<br>title:     $title<br>subtitle:  $subtitle<br><br>$description<br>EOF<br>```<br><br></div><div>John<br><br></div></div></div>