home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / coherent / 5544 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.6 KB

  1. Path: sparky!uunet!news.tek.com!uw-beaver!cs.ubc.ca!destroyer!caen!sdd.hp.com!spool.mu.edu!darwin.sura.net!dtix!mimsy!prometheus!media!twinbrk!bill
  2. From: bill@twinbrk.uucp (Bill Shotts)
  3. Newsgroups: comp.os.coherent
  4. Subject: Re: W-news help needed...
  5. Message-ID: <9211071631@twinbrk.uucp>
  6. Date: 9 Nov 92 16:38:58 GMT
  7. References: <9211012992@drktowr.chi.il.us>
  8. Reply-To: bill%twinbrk%media@uunet.uu.net
  9. Organization: Twinbrook Coherent System - Rockville, Maryland
  10. Lines: 43
  11. X-Newsreader: Tin 1.1 PL4
  12.  
  13. magus@drktowr.chi.il.us (Louis Giliberto) writes:
  14. : Help!!
  15. : My "history" file is out of control!!
  16. : I thought expire was supposed to prune this.  If not, how can I reduce
  17. : the size?  Any suggestions?
  18.  
  19. I discovered this problem too.  I run a script in my crontab to control
  20. its length and do other maintenance as follows:
  21.  
  22. --------------------------- cut here -----------------------------
  23.  
  24. #    shell program to perform daily news system maintainence
  25. #    william shotts, jr.    oct. 1992
  26.  
  27. NEWSDIR=/usr/lib/news
  28. DAYS=5
  29.  
  30. #    expire old news
  31. $NEWSDIR/expire -e $DAYS
  32.  
  33. #    control length of log files
  34. cp $NEWSDIR/log $NEWSDIR/log.1
  35. cp $NEWSDIR/errlog $NEWSDIR/errlog.1
  36. rm -f $NEWSDIR/log
  37. rm -f $NEWSDIR/errlog
  38.  
  39. #    control length of history file
  40. cp $NEWSDIR/history $NEWSDIR/history.1
  41. awk '
  42. {
  43.     if (NF < 8) {
  44.         print $0
  45.     }
  46. }
  47. ' $NEWSDIR/history.1 > $NEWSDIR/history
  48.  
  49. --------------------------- cut here -----------------------------
  50.  
  51. In the awk program the number of fields (NF < 8) is governed by the
  52. number of days that you keep news.  Note also that this script must be
  53. run as user "news" to have proper access to the news files.
  54.