🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #36129

Script to rebuild inn 2 overview & history

#36129
From: Alex French
Date: Tue, 23 Mar 1999 00:00
58 lines
2313 bytes
I've got a number of mails asking how to completely rebuild the history
and overview databases in inn-2, so here's the script I use. It was
originally written by someone who I can;t remember (if you're reading
this, put you hand up!) and modified slightly by me. It assumes you're NOT
using tagged hash. Takes about 40 mins on a 12G spool.


#!/bin/sh
# fixover: rebuild munged overview and history databases.

. /usr/local/news/etc/innshellvars

# Change to a big temp dir
TMPDIR=/news-toast

date >> log/fix.log

die () {
        echo "MakeHistory: $1 failed"
        trap 0
        exit 1
}
index=$TMPDIR/index.$$
size=`wc -l $HISTORY | awk '{print $1}'`
[ 0$size -gt 200000 ] || size=200000


reason="MakeHistory [$$]"

if [ -f $SERVERPID ]; then
        bin/ctlinnd -s go ""
        bin/ctlinnd -s throttle "$reason" || die "throttle"
        bin/ctlinnd -s readers n "$reason"
        trap "echo failure >> log/fix.log;rm -f $index; bin/ctlinnd go '$reason'
; bin/ctlinnd readers y '$reason'; trap 0; exit 0" 0 1 2 15
fi
killall nnrpd 2>/dev/null

echo "Starting makehistory" >> log/fix.log

bin/makehistory -O -I $index -T $TMPDIR -s $size || die "makehistory"

echo "Staring sort and expireindex" >> log/fix.log

sort -t' ' +1 -2 $index | bin/expireindex -a -o -z || die "expireindex"

echo "Installing new history files" >> log/fix.log

trap '' 1 2 15
mv -f $HISTORY.n.dir $HISTORY.dir || die "mv(1)"
mv -f $HISTORY.n.hash $HISTORY.hash
mv -f $HISTORY.n.index $HISTORY.index

echo "finished" >> log/fix.log
bin/ctlinnd flush ""
exit 0

Technical Details
Message-ID: <alex-2303991620560001@gzunda.medianet.ie>
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

Show Full Headers
Complete Article Headers
Message-ID: <alex-2303991620560001@gzunda.medianet.ie>
Subject: Script to rebuild inn 2 overview & history
Date: Tue, 23 Mar 1999 00:00:00 +0000
From: alex@medianet.ie (Alex French)
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: 458018131
Sender: french@gzunda.medianet.ie
X-Complaints-To: abuse@medianet.ie
X-Trace: fire.medianet.ie 922206056 29054 194.133.7.228 (23 Mar 1999 16:20:56 GMT)
Organization: MediaNet Ireland Ltd
NNTP-Posting-Date: 23 Mar 1999 16:20:56 GMT
Newsgroups: news.software.nntp