[mythtv-users] Script to email on failed recording

John P Poet jppoet at gmail.com
Fri Jul 22 15:13:16 UTC 2016


On Fri, Jul 22, 2016 at 6:03 AM Mark Perkins <perkins1724 at hotmail.com>
wrote:

> Does anyone have a simple script that they would be willing to share that
> fires off an email whenever there is failed recording?
>
> I am getting a tuner that drops out about once every couple of months - and
> if I am not watching a lot of shows at the time it can be a few days before
> I realise it.
>

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:

`/usr/local/bin/email_failure.sh "%CARDID%" "%CHANID%" "%STARTTIMEISOUTC%"
"%ENDTIMEISOUTC%" "%TITLE%" "%SUBTITLE%" "%DESCRIPTION%"`

and then have the following in /usr/local/bin/email_failure.sh:

```
 #! /bin/bash

cardid=$1
chanid=$2
starttime=$3
endtime=$4
title=$5
subtitle=$6
description=$7

recipients="<some email address>"
from="<some email address>"
subject="Recording failing"
message="The following recording did not start on time."

/usr/sbin/sendmail "$recipients" <<EOF
Subject:$subject
From:$from
To: <your email address>
$message

cardid:    $cardid
chanid:    $chanid
starttime: $starttime
endtime:   $endtime
title:     $title
subtitle:  $subtitle

$description
EOF
```

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20160722/af388deb/attachment.html>


More information about the mythtv-users mailing list