🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #15949

Re: purging junk directory

#15949
From: Dean Carpenter
Date: Mon, 17 Mar 1997 00:00
85 lines
3116 bytes
In article <MPG.d91def92cfc2788989686@news.kraft.com>, 
dcarpenter@kraft.com says...
--> We have junk expiring in 5 days here.  I wrote a script that parses all
--> the articles in junk and finally presents you with a script of ctlinnd
--> newgroup commands to add all the unknown newsgroups.  You delete the
--> lines in there for groups you don't want to add, then run it.
--> 
--> Server is paused, new groups added, server go'd.  Voila.  Since there
--> aren't *that* many newgroups being added too often, running this once
--> a week or less is usually sufficient, unless you want to catch all the
--> flakey alt.* new groups :)
--> 
--> It's not very big - if anyone is interested, I'll post it here.

OK already.  Here it is.  Anyone who's emailed me for a 
copy, I'll still email your own to you as well.

===========================================
#! /bin/sh
#
#       This script scans through all the articles in 
/usr/spool/news/junk
#       culling out the newsgroup names.  These groups 
are then written to
#       /tmp/grpadd as a script to add them with addgroup
#
#       Handy to bulk-add missing groups as needed or 
wanted.
#

. /usr/lib/news/innshellvars

rm -f /tmp/grpadd
rm -f /tmp/getjunk.[1-9]

echo "#!/bin/sh" > /tmp/grpadd
echo "#" >> /tmp/grpadd
echo "# Remove any unwanted groups, edit as desired, then 
save." >> /tmp/grpadd
echo "# Then, run /tmp/grpadd as news to create the 
groups listed here." >> /tmp/grpadd
echo "#" >> /tmp/grpadd
echo "$NEWSBIN/ctlinnd pause Adding new groups" >> 
/tmp/grpadd
echo >> /tmp/grpadd

# Get list of newsgroups from junk articles
#
echo getting list of newsgroups - getjunk.1
cd $SPOOL/junk
( ls -1 | \
xargs -n1 fgrep Newsgroups: | \
awk ' FS=":" { print $2 } ' | \
tr ',\040' '\012\012'  ) | \
sort | uniq > /tmp/getjunk.1

# Get list of newsgroups already in the active file
#
echo comparing to $ACTIVE file
cat $ACTIVE | cut -f 1 -d " " | \
cat /tmp/getjunk.1 - | sort | uniq -d | \
cat /tmp/getjunk.1 - | sort | uniq -u | \
xargs -n1 -i echo "$NEWSBIN/ctlinnd newgroup {}" >> 
/tmp/grpadd
echo >> /tmp/grpadd
echo "$NEWSBIN/ctlinnd go Adding new groups" >> 
/tmp/grpadd
echo rm /tmp/grpadd >> /tmp/grpadd
chmod +x /tmp/grpadd
vi /tmp/grpadd
echo
echo OK, now run /tmp/grpadd as news to create the 
newsgroups
echo
chown news.news /tmp/grpadd
===========================================

-- 
Dean Carpenter

dcarpenter@kraft.com
deano@areyes.com

Technical Details
Message-ID: <MPG.d972dc12e393c8198968b@news.kraft.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
References: <332243AA.505E@idris.com.au> <3325E8F6.24D9@interglobe.com> <MPG.d91def92cfc2788989686@news.kraft.com>

Show Full Headers
Complete Article Headers
Message-ID: <MPG.d972dc12e393c8198968b@news.kraft.com>
Subject: Re: purging junk directory
Date: Mon, 17 Mar 1997 00:00:00 +0000
From: dcarpenter@kraft.com (Dean Carpenter)
References: <332243AA.505E@idris.com.au> <3325E8F6.24D9@interglobe.com> <MPG.d91def92cfc2788989686@news.kraft.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: 226200641
Organization: Kraft Foods
Newsgroups: news.software.nntp