home *** CD-ROM | disk | FTP | other *** search
- 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
- From: bill@twinbrk.uucp (Bill Shotts)
- Newsgroups: comp.os.coherent
- Subject: Re: W-news help needed...
- Message-ID: <9211071631@twinbrk.uucp>
- Date: 9 Nov 92 16:38:58 GMT
- References: <9211012992@drktowr.chi.il.us>
- Reply-To: bill%twinbrk%media@uunet.uu.net
- Organization: Twinbrook Coherent System - Rockville, Maryland
- Lines: 43
- X-Newsreader: Tin 1.1 PL4
-
- magus@drktowr.chi.il.us (Louis Giliberto) writes:
- : Help!!
- :
- : My "history" file is out of control!!
- :
- : I thought expire was supposed to prune this. If not, how can I reduce
- : the size? Any suggestions?
-
- I discovered this problem too. I run a script in my crontab to control
- its length and do other maintenance as follows:
-
- --------------------------- cut here -----------------------------
-
- # shell program to perform daily news system maintainence
- # william shotts, jr. oct. 1992
-
- NEWSDIR=/usr/lib/news
- DAYS=5
-
- # expire old news
- $NEWSDIR/expire -e $DAYS
-
- # control length of log files
- cp $NEWSDIR/log $NEWSDIR/log.1
- cp $NEWSDIR/errlog $NEWSDIR/errlog.1
- rm -f $NEWSDIR/log
- rm -f $NEWSDIR/errlog
-
- # control length of history file
- cp $NEWSDIR/history $NEWSDIR/history.1
- awk '
- {
- if (NF < 8) {
- print $0
- }
- }
- ' $NEWSDIR/history.1 > $NEWSDIR/history
-
- --------------------------- cut here -----------------------------
-
- In the awk program the number of fields (NF < 8) is governed by the
- number of days that you keep news. Note also that this script must be
- run as user "news" to have proper access to the news files.
-