Article View: news.software.nntp
Article #18665Re: Control Group - Update
From: Michael Hucka
Date: Tue, 24 Jun 1997 00:00
Date: Tue, 24 Jun 1997 00:00
69 lines
3975 bytes
3975 bytes
>>>>> On 24 Jun 1997, dillon@flea.best.net (Matt Dillon) wrote:
dillon> I wrote a program called 'newsprune' a while back.. it's on my site
dillon> ( http://www.backplane.com/ ), in the INN/NEWS section which runs
dillon> through the spool and removes article files that do not exist in
dillon> the history file. I run it once a day to clean up after INN. It's
dillon> very fast.... it scans the history file and constructs range lists
dillon> for each group, then scans the spool directory removing any article
dillon> that does not match the range lilst for that group.
Let me endorse "newsprune" as a great utility -- thanks for writing it and
making it available!
dillon> I've also started doing the equivalent of an rm -rf on the
dillon> control/cancel directory once an hour now. The spamming and
dillon> followup cancels have gotten a lot worse in the last four weeks.
I've been trying to come up with an alternative to rm'ing the control/cancel
directory that will trim its size, but still keep cancels around so that they
will have a chance of being propagated. Here's what I have so far; I haven't
had time to work on something better.
1) I run the following `cleancancels' script every 3 hours. Its purpose is
to recreate the control/cancel directory and copy back into it those
cancel messages that are younger than 24 hours. At least on my system
(Solaris 2.5.1), it's important to create a *new* directory, not just
delete articles, in order to get a performance improvement. (Thus, some
of the solutions proposed by others in this discussion thread don't
actually make a difference on my system, because they only delete the
cancel articles and don't recreate the directory. This includes the
approach of running expire multiple times per day.) The use of the
1-day-old criterion is a compromise between nuking everything and keeping
cancel messages long enough to let most sites get them.
2) Rather than having this script do an rm -rf on the directory, I have a
separate process out of cron do it once a night, for all the cancel.ZZZZZ
directories created by the script. The reason is that doing the rm -rf
beats on the disk significantly (offsetting some of the performance
improvements sought in the first place), so I think it's better to lump
the deletions into one event.
Also, make sure that your expire.ctl has an expiration for control.cancel
that is longer than 1 day.
#!/bin/sh -x
#
# Description : Clean up the cancel directory.
# Author(s) : Michael Hucka <hucka@eecs.umich.edu>
# Organization: University of Michigan EECS DCO
# Created : 1997-06-24
#
# IMPORTANT: This script relies on a second process, presumably run from
# cron, to delete the cancel.ZZZZZ directories that it creates.
PATH=${PATH}:/news/bin:/usr/gnu/bin
export PATH
cd /news/spool/control/
mv cancel cancel.$$
mkdir cancel
find cancel.$$ -type f -mtime -1 -print | xargs -i /bin/mv "{}" cancel
--
Mike Hucka hucka@umich.edu http://www.eecs.umich.edu/~hucka University
PhD to be, computational models of human visual processing (AI Lab) of
UNIX systems administrator & programmer/analyst (EECS DCO) Michigan
Technical Details
Message-ID:
<823eq7l93c.fsf@ikonas.eecs.umich.edu>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:
<5oopoj$lnj@shell.monmouth.com> <87radsm02x.fsf@tmill06.sch.advantis.com> <5opbjq$n8c$1@flea.best.net>Show Full Headers
Complete Article Headers
Message-ID: <823eq7l93c.fsf@ikonas.eecs.umich.edu> Subject: Re: Control Group - Update Date: Tue, 24 Jun 1997 00:00:00 +0000 From: Michael Hucka <hucka@eecs.umich.edu> References: <5oopoj$lnj@shell.monmouth.com> <87radsm02x.fsf@tmill06.sch.advantis.com> <5opbjq$n8c$1@flea.best.net> 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: 252369502 Distribution: inet Organization: University of Michigan EECS, Ann Arbor, Mich., USA Newsgroups: news.software.nntp