🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #91300

Re: force expiration by path?

#91300
From: Dave McGuire
Date: Thu, 14 Dec 2023 02:42
43 lines
2532 bytes
On 12/11/23 00:14, Grant Taylor wrote:
> That being said, I did a find across /var/spool/news/articles and had it 
> exec a script per article that looked for Message-IDs that ended with 
> @googlegroups.com.
> 
> This  is actually the second time I've done this.  The first time I did 
> it the process removed nearly seven million articles.  Then I found out 
> that the Message-ID had a different pattern, likely as fields grew over 
> time.  So I re-ran the process with a more forgiving format.
> 
>     export LC_ALL=C
>     egrep -lm1 "^Message-ID: 
> <[0-9A-Za-z]+-[0-9A-Za-z]+-[0-9A-Za-z]+-[0-9A-Za-z]+-[0-9A-Za-z]+@googlegroups.com>$" ${1} > /dev/null 2>&1
>     if [ ${?} -eq 0 ]; then
>          echo -n "X"
>          rm ${1}
>     fi
> 
> I'm sure there are other ways to do this.  But it worked for me.  I was 
> able to let it run in the background in a window.
> 
>     time (clear; find $(pwd) -type d | while read DIR; do echo -n 
> "${TS}${${DIR/\/var\/spool\/news\/articles\//}//\//.}${FS}"; find ${DIR} 
> -maxdepth 1 -type f -exec 
> /root/remove-google-groups-news-posting-if-its-spam.sh {} \; ; done; echo)
> 
> The echo / ${TS} / ${FS} isn't important, much less required.  It's 
> there because I wanted to update the window title to be the newsgroup 
> that was being worked on.
> 
> I'm sure there are better ways to do this.  But this has worked for me 
> to do exactly what you're asking to do.

   Hi Grant, thank you, I'll give this a shot.  The window title thing 
is a nice touch. :)

              Thanks,
              -Dave

-- 
Dave McGuire, President/Curator
Large Scale Systems Museum
New Kensington, PA
Technical Details
Message-ID: <uldq2o$4rn$1@mail.neurotica.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <ul5nl4$18j4$1@mail.neurotica.com> <ul65qq$74a$1@tncsrv09.home.tnetconsulting.net>

Show Full Headers
Complete Article Headers
Message-ID: <uldq2o$4rn$1@mail.neurotica.com>
Subject: Re: force expiration by path?
Date: Wed, 13 Dec 2023 21:42:32 -0500
From: Dave McGuire <mcguire@lssmuseum.org>
References: <ul5nl4$18j4$1@mail.neurotica.com> <ul65qq$74a$1@tncsrv09.home.tnetconsulting.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: LSSM
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 14 Dec 2023 02:42:33 -0000 (UTC)
User-Agent: Betterbird (Linux)
Content-Language: en-US
In-Reply-To: <ul65qq$74a$1@tncsrv09.home.tnetconsulting.net>