home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # $Id: mt.check.SH,v 3.0 1993/09/22 04:11:10 davison Trn $
- #
- # mt.check - daily maintenance for mt.log
- #
- # Check mt.log for earth-shattering errors, and mail them to $gurus if found.
- # Then move the mt.log file into a week-long history chain.
- #
- # Usage: mt.check
- #
-
- gurus="news"
- tmp="/tmp/mt.c$$"
-
- PATH=/bin:/usr/bin
- export PATH
-
- umask 002
-
- trap "rm -f $tmp ; exit 0" 0 1 2 15
-
- cd /usr/lib/mthreads
-
- /usr/bin/egrep " \*\*$" mt.log >$tmp
-
- if test -s $tmp ; then
- (cat <<EOT
- To: $gurus
- Subject: mthreads error!
-
- The following errors were reported in mt.log. If the error pertains to
- the active file, you should lock down your news system and fix it. If
- it is a thread-releated bug and it persists, please report this fact to
- Wayne Davison (davison@borland.com). Mention version "3.1".
-
- EOT
- cat $tmp) | mail $gurus
- fi
-
- test -f mt.log.6 && mv mt.log.6 mt.log.7
- test -f mt.log.5 && mv mt.log.5 mt.log.6
- test -f mt.log.4 && mv mt.log.4 mt.log.5
- test -f mt.log.3 && mv mt.log.3 mt.log.4
- test -f mt.log.2 && mv mt.log.2 mt.log.3
- test -f mt.log && mv mt.log mt.log.2
- touch mt.log
-
- exit 0
-