Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!oliveb!pyramid!voder!tolerant!vsi1!unisv!vanpelt From: vanpelt@unisv.UUCP (Mike Van Pelt) Newsgroups: news.misc Subject: usr/spool/news/junk runneth over Message-ID: <213@unisv.UUCP> Date: 15 Mar 88 22:02:45 GMT Organization: Unisys Silicon Valley, San Jose, CA Lines: 53 I've just started getting a news feed, and I've come across a problem that's probably common to all new sites: Newsgroups that are not in the newslib/active file. All those articles get sent to the junk newsgroup, which soon has biilyons and biilyons of articles in it. There doesn't seem to be a way provided to move them, so here's the script I kludged up to do it. ====beginning of script==== #!/bin/sh # Shell to create new newsgroups from the Newsgroups: line in every # article in .../news/junk, remove everything from junk, and repost # it all in the appropriate new newsgroups. # # ** BUG WARNING ** Doesn't work if there is only one message # in .../news/junk! Check before running. # cd /usr/lib/news mkdir landfill cp /usr/spool/news/junk/* landfill grep \^Newsgroups: landfill/* | cut -f3 -d: | sort | uniq >fixup1 ed - fixup1 <<'EOF' 1,$s/,/\ /g 1,$s/^/inews -C / 1,$s;$; fixup2 ed - fixup2 <<'EOF' 1,$s;^;inews -x vsi1 -h -p landfill/; w q EOF sh fixup2 ====end of script==== Then after it looks like everything worked, rm -r -f landfill The directories for news lib & spooling may need to be changed at your site. Also, in the second editor script, "vsi1" should be changed to the site(s) from which you get your newsfeed. Note that this script blindly and indescriminantly creates newsgroups for any and all messages in the junk group. This may or may not be desireable. If there's a better way, I'd love to hear about it! -- Mike Van Pelt ..uunet!ubvax!unisv!vanpelt