Article View: news.software.nntp
Article #35331Re: Using a separate machine for readers
From: Brad Knowles
Date: Thu, 11 Feb 1999 00:00
Date: Thu, 11 Feb 1999 00:00
57 lines
2753 bytes
2753 bytes
In article <79t2se$bmg@dfw-ixnews7.ix.netcom.com>, bugs@freebsd.netcom.com
(Mark Hittinger) wrote:
> In either case its a terrific idea Brad, I can make good use of it here
> with some minor tweaking. Thanks for telling us about it.
>
> Every time I think I've heard the last great INN hack ......
This is extremely crude, but here's what we've now got for
light-history.pl (from what I can tell, it lops off about 1/3 the number
of bytes and 1/2 the number of lines in the master history file, making
the new one 2422115 lines long, versus 4337514):
#!/usr/local/bin/perl
open(IN,"</usr/local/news/db/history") or die "Cannot read history";
open(OUT,">/usr/local/news/db/readers-history.n") or die "Cannot write
light history";
while(<IN>) {
if (/(^<\S+>)\s+(\d+~-~\d+)\s+(\S+)/) {
print OUT "$1\t$2\t$3\n";
}
elsif (/(^<\S+>)\s+(\d+~\d+~\d+)\s+(\S+)/) {
print OUT "$1\t$2\t$3\n";
}
}
print "Throttling\n";
system('ctlinnd throttle "Making light history"');
print "Flushing\n";
system('ctlinnd flush historyd!');
print "Flushing\n";
system('ctlinnd flush historyd!');
while(<IN>) {
if (/(^<\S+>)\s+(\d+~-~\d+)\s+(\S+)/) {
print OUT "$1\t$2\t$3\n";
}
}
print "Un-throttling\n";
system('ctlinnd go "Making light history"');
close(OUT);
close(IN);
system('mv /usr/local/news/db/readers-history.n
/usr/local/news/db/readers-history');
--
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
<http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0xE38CCEF1>
If you wouldn't take out a one-page ad in the Wall Street
Journal to say something, then don't say it by email.
Technical Details
Message-ID:
<brad-1102991128380001@brad.techos.skynet.be>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:
<79qni9$a7j$1@mulga.cs.mu.OZ.AU> <brad-1002991259050001@brad.techos.skynet.be> <79s5ri$5jq8$1@newssvr03-int.news.prodigy.com> <brad-1002991739080001@brad.techos.skynet.be> <87ww1qvul9.fsf@erlenstar.demon.co.uk> <brad-1002992328020001@brad.techos.skynet.be> <79t2se$bmg@dfw-ixnews7.ix.netcom.com>Show Full Headers
Complete Article Headers
Message-ID: <brad-1102991128380001@brad.techos.skynet.be> Subject: Re: Using a separate machine for readers Date: Thu, 11 Feb 1999 00:00:00 +0000 From: brad@shub-internet.org (Brad Knowles) References: <79qni9$a7j$1@mulga.cs.mu.OZ.AU> <brad-1002991259050001@brad.techos.skynet.be> <79s5ri$5jq8$1@newssvr03-int.news.prodigy.com> <brad-1002991739080001@brad.techos.skynet.be> <87ww1qvul9.fsf@erlenstar.demon.co.uk> <brad-1002992328020001@brad.techos.skynet.be> <79t2se$bmg@dfw-ixnews7.ix.netcom.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: 443165019 X-Complaints-To: abuse@skynet.be X-Trace: news1.skynet.be 918728921 16139 195.238.1.121 (11 Feb 1999 10:28:41 GMT) Organization: Shub-Internet X-URL: http://www.shub-internet.org/ NNTP-Posting-Date: 11 Feb 1999 10:28:41 GMT Newsgroups: news.software.nntp