[mythtv] [PATH] mythfilldatabase warning system

Tako Schotanus quintesse at palacio-cristal.com
Mon May 3 18:12:54 EDT 2004


Just a tiny patch for mythfilldatabasecron that checks the number of 
days that are left in the program table and sends an email warning that 
you're almost out of data in your program guide. (Guess why I made this 
patch? ;-)

The defaults in the file send a message to root when the amount drops 
below 3 days.

Cheers,
-Tako

-------------- next part --------------
Index: configfiles/mythfilldatabasecron
===================================================================
RCS file: /var/lib/mythcvs/mythtv/configfiles/mythfilldatabasecron,v
retrieving revision 1.1
diff -b -2 -r1.1 mythfilldatabasecron
1a2
> 
3a5,25
> 
> # The minimum number of days you will allow before you
> # want to receive a notification message
> MIN_DAYS=3
> 
> # The e-mail address to send the warning message to
> EMAIL=root
> 
> DB=mythconverg
> SQL='SELECT TO_DAYS(max(endtime)) - TO_DAYS(now()) FROM program;'
> 
> DAYS_LEFT=`mysql --skip-column-names -B -D $DB --execute "$SQL"`
> 
> if [ $DAYS_LEFT -lt $MIN_DAYS ]; then
> 	mail -s "[MYTHTV] Only $DAYS_LEFT days of programs left!" $EMAIL <<-END
> 		Maybe you should check if mythfilldatabase is configured
> 		correctly or that your XMLTV service provider is still
> 		on-line?
> 	END
> fi
> 


More information about the mythtv-dev mailing list