Hi folks. Can anyone tell me if there's a way to tell INN to expire
a set of articles, as a one-time operation, based on their path?
I'm sure it's obvious that my goal is to get rid of all the Google
spam from the spool. I just filtered them in my cleanfeed configuration
but would like to purge the articles that are already there, as my
server is set up with a long expiration period.
A perusal of the docs for expire and such have turned up nothing, so
I'd appreciate some advice on whether or not there's a way to do this.
Can anyone tell me if there's a way to tell INN to expire
a set of articles, as a one-time operation, based on their path?
A perusal of the docs for expire and such have turned up nothing, so
I'd appreciate some advice on whether or not there's a way to do this.
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. :)
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>$"
Hi Grant, thank you, I'll give this a shot. The window title thing
is a nice touch. :)
Hi Dave,
You're welcome.
Please let me know if it works or if you have questions.
Hi Grant, yes it did indeed work. Thank you for your advice.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 67:35:25 |
Calls: | 6,915 |
Files: | 12,379 |
Messages: | 5,431,813 |