[mythtv] Re: [PATCH] mythfilldatabase warning system
Tako Schotanus
quintesse at palacio-cristal.com
Thu May 6 04:26:09 EDT 2004
Skipped content of type multipart/alternative-------------- next part --------------
Index: configfiles/mythfilldatabasecron
===================================================================
RCS file: /var/lib/mythcvs/mythtv/configfiles/mythfilldatabasecron,v
retrieving revision 1.1
diff -u -2 -r1.1 mythfilldatabasecron
--- configfiles/mythfilldatabasecron 12 Nov 2002 02:40:50 -0000 1.1
+++ configfiles/mythfilldatabasecron 6 May 2004 08:24:08 -0000
@@ -1,3 +1,25 @@
#!/bin/bash
+
export QTDIR=/usr/lib/qt3
/usr/local/bin/mythfilldatabase
+
+# 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