🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by Alex French Tue, 23 Mar 1999 00:00
Script to rebuild inn 2 overview & history
#36129
Author: 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

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads