home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / lib / mthreads / mt.check < prev    next >
Encoding:
Text File  |  1995-05-14  |  1.1 KB  |  49 lines

  1. #!/bin/sh
  2. # $Id: mt.check.SH,v 3.0 1993/09/22 04:11:10 davison Trn $
  3. #
  4. # mt.check - daily maintenance for mt.log
  5. #
  6. # Check mt.log for earth-shattering errors, and mail them to $gurus if found.
  7. # Then move the mt.log file into a week-long history chain.
  8. #
  9. # Usage: mt.check
  10. #
  11.  
  12. gurus="news"
  13. tmp="/tmp/mt.c$$"
  14.  
  15. PATH=/bin:/usr/bin
  16. export PATH
  17.  
  18. umask 002
  19.  
  20. trap "rm -f $tmp ; exit 0" 0 1 2 15
  21.  
  22. cd /usr/lib/mthreads
  23.  
  24. /usr/bin/egrep " \*\*$" mt.log >$tmp
  25.  
  26. if test -s $tmp ; then
  27.     (cat <<EOT
  28. To: $gurus
  29. Subject: mthreads error!
  30.  
  31. The following errors were reported in mt.log.  If the error pertains to
  32. the active file,  you should lock down your news system and fix it.  If
  33. it is a thread-releated bug and it persists, please report this fact to
  34. Wayne Davison (davison@borland.com).  Mention version "3.1".
  35.  
  36. EOT
  37.     cat $tmp) | mail $gurus
  38. fi
  39.  
  40. test -f mt.log.6 && mv mt.log.6 mt.log.7
  41. test -f mt.log.5 && mv mt.log.5 mt.log.6
  42. test -f mt.log.4 && mv mt.log.4 mt.log.5
  43. test -f mt.log.3 && mv mt.log.3 mt.log.4
  44. test -f mt.log.2 && mv mt.log.2 mt.log.3
  45. test -f mt.log   && mv mt.log   mt.log.2
  46. touch mt.log
  47.  
  48. exit 0
  49.