LinHES Forums
http://forum.linhes.org/

email me if mythfilldatabase has an error
http://forum.linhes.org/viewtopic.php?f=3&t=17675
Page 1 of 1

Author:  ruud.wijnen [ Sat Jan 19, 2008 7:36 am ]
Post subject:  email me if mythfilldatabase has an error

Thank you developers for mythtv and the people who made it "easy" to install. I use it for 2 years now and back then it took me some time to get everything going. I was a novice with linux but i was determent by the beautiful screen shots.
Since then the (digital) world around us changed and that is why mythtv sometimes gives not the expected behavior.
Occasionally mythfilldatabase does not run correct due to tv-guide server overload or change in the web page of the tv-guide server.
I wrote a script that sends me an email at work so when I come home I can run mythfilldatabase manually or update the script tv_grab_nl_py
I live in the Netherlands and I use the tv guide grabber from http://graphics.tudelft.nl/~paul/grabber/ (many kudos for pauls excellent work)

first install sendEmail
instructions and download at http://caspian.dotconf.net/menu/Software/SendEmail/

here is the script;

#! /bin/bash
DATA="$(mysql -u mythtv -pmythtv -s mythconverg -e "select settings.data from settings where settings.value like '%mythfilldatabaseLastRunStatus%'";)"
if [ "$DATA" = "Successful." ]; then
echo "datagrabber succesvol"
else
perl /usr/sbin/sendEmail -f sender@adres.nl -t emailadress@work.nl -u "PVR" -s smtp.provider.nl -m "failed to fetch data, check your tvguide"
fi

save this as /home/mythtv/tvguideerror and make it executable


now add to /etc/crontab
01 14 * * 1-5 root su mythtv /home/mythtv/tvguideerror

this will run the script every working day at one minute past two in the afternoon. since mythtv fills my database in the morning (you can set this up in the config pages of mythtv) it gives you the latest status.

its very easy to expand the script and send more info (have fun)

I know the script can be improved but it suits my needs for now.

Ruud Wijnen
Asus Pundit, Hauppauge 350, R5D1

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/