Article View: news.software.nntp
Article #31678Re: Deleting lots o'groups
From: Conrad Sabatier
Date: Thu, 24 Sep 1998 00:00
Date: Thu, 24 Sep 1998 00:00
67 lines
2340 bytes
2340 bytes
In article <360923BF.3E583988@vii.com>, Kerry J. Cox <kjcox@vii.com> wrote:
>Okay, two questions and I'm sure many of you wil think them very simple
>but I've been reading all the FAQs and man pages and it's still a bit
>vague. I can delete groups individually by typing
> /full_path/ctlinnd rmgroup "offensive.group"
>But when I try to delete an entire hierarchy:
> /full_path/ctlinnd rmgroup "offensive.group.*"
>It states there is no group by that name. How do I delet an entire
>group hierarchy and all the subgroups.
You can't. Well, you *can*, but not with a single command to INN.
Here are a couple of scripts I use, rmhier and rmhier.wild. The first
lets you remove a set of hierarchies. The second lets you remove a set of
hierarchies using any part of a hierarchy name. Examine the source code
for the details, or e-mail me, if you like. You may need to edit the
pathnames, if your news spool is somewhere other than /usr/spool/news.
Both have been very useful for me.
----- rmhier (sh) -----
#!/bin/sh
# Remove (ctlinnd rmgroup) a hierarchy (or hierarchies) of newsgroups
for hier in $*
do
echo
echo Removing $hier hierarchy from active file
echo
for grp in `grep -we "^$hier" ~news/lib/active | sed "s/ .*$//"`
do
echo Removing $grp
ctlinnd rmgroup $grp
done
echo
echo Removing $hier hierarchy from news spool
echo
h=`echo $hier | sed "s/\./\//g"`
rm -rf /usr/spool/news/$h
echo
echo Removing $hier hierarchy from overview
echo
rm -rf /usr/spool/news/over.view/$h
done
----- end rmhier -----
----- rmhier.wild -----
#!/bin/sh
for g in $*
do
for h in `grep -e "$g" < ~news/lib/active | awk '{print $1}'`
do
rmhier $h
done
done
----- end rmhier.wild -----
Technical Details
Message-ID:
<6ucgsu$mm7$1@dolphin.neosoft.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-mailReferences:
<360923BF.3E583988@vii.com>Show Full Headers
Complete Article Headers
Message-ID: <6ucgsu$mm7$1@dolphin.neosoft.com> Subject: Re: Deleting lots o'groups Date: Thu, 24 Sep 1998 00:00:00 +0000 From: conrads@neosoft.com (Conrad Sabatier) References: <360923BF.3E583988@vii.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: 394363569 Organization: NeoSoft, Inc. Newsgroups: news.software.nntp