Article View: news.software.nntp
Article #16301Re: Inn-1.5.1's file space recovery problem
From: Per Hedeland
Date: Tue, 25 Mar 1997 00:00
Date: Tue, 25 Mar 1997 00:00
59 lines
3157 bytes
3157 bytes
In article <5h80l7$6bi$1@stealth.eng.pyramid.com>, mark@stealth.eng.pyramid.com (Mark Wedel) writes: > I had a similar problem. A fairly simple solution is to add a few >lines in the news.daily to zero out the files before the are removed/ >copied over (somethine like echo > history). This is the same idea as >what is used to zero out the log files. > > Now the nnrpd process won't like it (will probably die on its own, because >the history file it was using is now gone), but you might consider this a >reasonable risk (worst case is that the user just needs to restart whatever >newsreader.) A somewhat friendlier method is to keep the old history around for the following 24 hrs, and zero it out before the next-next one is built. If you rebuild history in the same directory as the old one (the default), you need to have space for two versions anyway, and having them there all the time actually increases the likelihood that e.g. innwatch will warn you of space shortage before it is too late.:-) Below is the little script 'histtrunc' I use for this - credits go to Jerry Aguirre (if memory serves) for pointing out that you need to be careful to avoid zeroing out the current version.:-) N.B. that you don't need to modify news.daily for this. --Per Hedeland per@erix.ericsson.se #!/bin/sh # histtrunc - avoid old unlinked versions of the history file eating space # # Works by keeping a link to the old version around, and truncating it to # zero size at the next expire run. You need to have space for two versions # obviously, but you normally need that anyway for expire - and this way # you can be pretty certain expire doesn't run out of space. # # Should be run immediately before expire, e.g. by giving /path/to/histtrunc # as argument to news.daily. # The full pathname of the history file - adjust as needed HISTORY=/opt/news/history if [ -f $HISTORY.old ] # old version found then # We need to make sure this isn't actually the current version, # e.g. due to the previous expire having aborted - compare the # inode numbers. set -- `ls -i $HISTORY.old $HISTORY` if [ "$1" != "$3" ] # not the current one then cp /dev/null $HISTORY.old rm $HISTORY.old ln $HISTORY $HISTORY.old fi # do nothing if it was the current one else # no old version - just create it ln $HISTORY $HISTORY.old fi
Technical Details
Message-ID:
<5h8brq$5ln$2@news.du.etx.ericsson.se>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<01bc36e6$03f38440$e4e893cf@valued-cu> <5h1h8i$p5f@uni00nw.unity.ncsu.edu> <5h7073$n0s$1@news.ibm.net.il> <5h7hok$4h7@uni00nw.unity.ncsu.edu> <5h80l7$6bi$1@stealth.eng.pyramid.com>Show Full Headers
Complete Article Headers
Message-ID: <5h8brq$5ln$2@news.du.etx.ericsson.se> Subject: Re: Inn-1.5.1's file space recovery problem Date: Tue, 25 Mar 1997 00:00:00 +0000 From: per@erix.ericsson.se (Per Hedeland) References: <01bc36e6$03f38440$e4e893cf@valued-cu> <5h1h8i$p5f@uni00nw.unity.ncsu.edu> <5h7073$n0s$1@news.ibm.net.il> <5h7hok$4h7@uni00nw.unity.ncsu.edu> <5h80l7$6bi$1@stealth.eng.pyramid.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 228203684 Sender: per@aalborg (Per Hedeland) Organization: Ericsson Telecom, Stockholm, Sweden Newsgroups: news.software.nntp