Article View: news.software.nntp
Article #66273Re: Removing duplicates in inn 2.2 tradspool
From: Paul Tomblin
Date: Mon, 21 Jul 2003 23:44
Date: Mon, 21 Jul 2003 23:44
41 lines
2368 bytes
2368 bytes
In a previous article, jeff@litech.org (Jeffrey M. Vinocur) said:
>>follow the steps in the makehistory man page to rebuild the history file,
>>will that automatically remove the duplicates, or will I have to do that
>>as a separate step? Will news.daily do it?
>
>Somebody may correct me here, but I think you've got to do it on
>your own :-/
Bummer.
>It shouldn't be but a little bit of Perl, I think, since you only
>need to consider the files in a single directory at any given
>time.
Call me an old traditionalist, but I use find and a script:
find . -type d -exec remove_dups.sh {} \;
remove_dups.sh looks like:
#!/bin/sh
cd $1
echo "doing $1"
grep -i '^message-id: ' * |sed 's/^[0-9]*:[Mm]essage-[Ii][Dd]: //' | sort | uniq -d >> /tmp/$$.out
for i in `cat /tmp/$$.out` ; do
echo "duplicate message $i"
grep -l $i * | head -1 | xargs rm
done
rm /tmp/$$.out
I'm sure I could have done it more efficiently or something in perl, but
it was faster to write it this way.
--
Paul Tomblin <ptomblin@xcski.com>, not speaking for anybody
---------------- hit any user to continue ----------------
Technical Details
Message-ID:
<bfhttq$n2d$1@allhats.xcski.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.20140818.mbox.gz!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!216.218.192.242!news.he.net!news.kjsl.com!xcski.com!not-for-mailReferences:
<bfh9ai$ent$1@allhats.xcski.com> <bfhkca$h9h$2@puck.litech.org>Show Full Headers
Complete Article Headers
Message-ID: <bfhttq$n2d$1@allhats.xcski.com> Subject: Re: Removing duplicates in inn 2.2 tradspool Date: Mon, 21 Jul 2003 23:44:58 +0000 From: ptomblin@xcski.com (Paul Tomblin) References: <bfh9ai$ent$1@allhats.xcski.com> <bfhkca$h9h$2@puck.litech.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!216.218.192.242!news.he.net!news.kjsl.com!xcski.com!not-for-mail Newsgroups: news.software.nntp Organization: Tomblin Computer Consulting, Rochester, New York and Ottawa, Ontario Lines: 41 Reply-To: ptomblin@xcski.com (Paul Tomblin) NNTP-Posting-Host: allhats.xcski.com X-Trace: allhats.xcski.com 1058831098 23629 192.168.1.1 (21 Jul 2003 23:44:58 GMT) X-Complaints-To: abuse@xcski.com NNTP-Posting-Date: Mon, 21 Jul 2003 23:44:58 +0000 (UTC) X-Newsreader: trn 4.0-test70 (17 January 1999) Originator: ptomblin@xcski.com (Paul Tomblin)