Newsgroups: news.software.b
Path: utzoo!utgpu!jarvis.csri.toronto.edu!me!radio.astro!brian
From: brian@radio.utoronto.ca (Brian Glendenning)
Subject: Re: Comments on C news
Message-ID: <BRIAN.89Jun24012248@radio.utoronto.ca>
In-reply-to: bill@twwells.com's message of 23 Jun 89 10:40:01 GMT
Sender: brian@radio.astro.utoronto.ca (Brian Glendenning)
Organization: Radio Astronomy, Univeristy of Toronto
References: <2228@vicom.COM> <1989Jun20.211939.7835@utzoo.uucp> <2277@vicom.COM> <1989Jun22.174603.10483@utzoo.uucp> <1989Jun23.104001.284@twwells.com>
Date: Sat, 24 Jun 89 05:22:54 GMT

In article <1989Jun23.104001.284@twwells.com> bill@twwells.com (T. William Wells) writes:
   will often use it all up. The way I've set this up is to prevent
   newsrun from running when there is less than 1M of free space, as a
   last ditch measure. But I run expire whenever I have less than 2M
   free; this is checked every hour.


Maybe I can mention my grotty little trick. I have news batches come
in on a different file system then /news. I expire when I need to from
newsrun, i.e. I drive the expire from newsrun, I don't run expire from
crontab:

*** newsrun	Sat Jun 24 01:12:03 1989
--- newsrun.orig	Sat Jun 24 01:12:38 1989
***************
*** 7,13 ****
  PATH=$NEWSCTL/bin:$NEWSBIN/input:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH
  umask $NEWSUMASK
  
- explevel=0
  here="$NEWSARTS/in.coming"
  cd $here
  
--- 7,12 ----
***************
*** 74,91 ****
  			rm -f $f
  			continue		# ugh
  		fi
! 		# Try to automatically clean up enough space if necessary.
! 		while test " `spacefor $batchsize articles`" -le 0
! 		do
! 			explevel=`expr $explevel + 1`
! 			if [ $explevel -gt 5 ]
! 			then
! 				echo '!!! Expiry Fails !!!' | mail $NEWSMASTER
! 				exit 1
! 			fi
! 			divactive $explevel < $NEWSCTL/explist.master > $NEWSCTL/explist
! 			$NEWSBIN/expire/doexpire
! 		done
  
  		# Decompress if necessary.
  		text=nruntmp.$$
--- 73,82 ----
  			rm -f $f
  			continue		# ugh
  		fi
! 		if test " `spacefor $batchsize articles`" -le 0
! 		then
! 			exit 0
! 		fi
  
  		# Decompress if necessary.
  		text=nruntmp.$$

(divactive just divides times in explist format, i.e.:

#! /bin/sh
# Divide times (no dashes and not a comment) by two in Cnews history files.

while read group status time archive
do
	if [ `expr $group : '#'` -eq 0 -a `expr $time : '.*-.*'` -eq 0 ]
	then
		echo $group $status `expr $time / $1` $archive
	else
		echo $group $status $time $archive
	fi
done
exit 0

While the above may not be the most elegant technique in the world,
it has done a reasonably good job of expiry-on-demand in a reasonably
small news partition (~20M) since we installed Cnews alpha a year or
so ago. Certainly it has kept the disk from blowing up occasionally
like it used to in the good old days. (Caveat - I just installed the
new Cnews today, and the above is reworked from what I had been
running, there may be problems that haven't shown up yet. However the
general idea should still be ok).

Now we get to see if I get a double signature :-)
--
	  Brian Glendenning - Radio astronomy, University of Toronto
brian@radio.astro.utoronto.ca uunet!utai!radio!brian  glendenn@utorphys.bitnet
-- 
	  Brian Glendenning - Radio astronomy, University of Toronto
brian@radio.astro.utoronto.ca uunet!utai!radio!brian  glendenn@utorphys.bitnet
