Article View: news.software.nntp
Article #16948Re: Cleaning out news spool directories after changing expire.ctl
From: Joerg Lehners
Date: Mon, 14 Apr 1997 00:00
Date: Mon, 14 Apr 1997 00:00
100 lines
3201 bytes
3201 bytes
In <5ifodh$1m0$1@lios.apana.org.au> cdewick@lios.apana.org.au (Craig Dewick) writes:
>[... old article files left ...]
>My presumption is that these articles are somehow being removed from the
>history file, and then they exist in limbo because expire doesn't know they
>still exist (because they're not in the history file), so they won't get
>deleted. Does this sound like a plausible theory? How could they get removed
>from the history file and not be deleted though? Something wrong with expire
>in a previous release of Inn prior to 1.5.1?
I think you have a glitch in your expire setup.
>[...]
>So, is there a way with something in the inn package to go through the
>entire news spool and purge all articles that are really, really old and
>appear to be getting left behind and ignored? [...]
I'm slightly paranoid and I'm using the following script once in a week:
#!/bin/sh
#
# ~news/local/checkold Joerg Lehners, March 1997
# Joerg.Lehners@Informatik.Uni-Oldenburg.DE
#
## =()<. @<_PATH_SHELLVARS>@>()=
. /usr/local/lib/inn/bin/innshellvars
#
PROGNAME=${0}
LOG=${MOST_LOGS}/checkold.log
#
REASON='checkold running'
#
echo "${0}: starting."
#
# ctlinnd throttle ${REASON}
${NEWSLIB}/local/throttle ${REASON}
#
cd ${SPOOL}
#
find . -type f -mtime +14 -print 2>/dev/null |
while read FILE
do
if [ ! -f ${FILE} ] ; then
continue
fi
echo -n "${FILE} "
MSGID=`sed -n -e '
/^$/q
/^Message-ID: /{
s/.*: *\(.*\)/\1/p
q
}' ${FILE}`
if [ X"${MSGID}" = X ] ; then
echo "NO Message-ID"
rm -f ${FILE}
continue
fi
echo -n "${MSGID} "
case `grephistory ${MSGID} 2>&1` in
[nN]ot* ) GONE=true ;;
/dev/null ) GONE=true ;;
'' ) GONE=true ;;
* ) GONE=false ;;
esac
if [ "${GONE}" = true ] ; then
rm -f ${FILE}
echo "REMOVED"
else
echo
fi
done > ${LOG}
#
ctlinnd go ${REASON}
ctlinnd renumber ''
#
echo "${0}: done."
The script checks all articles older a certain date and removes them
when it can't find an entry in the history db.
You probably want to tweak the '+mtime <days>' value, or else lots
of good articles will be checked unnecessarily.
Don't forget to check the log file.
Joerg
--
Mail: Joerg.Lehners@arbi.Informatik.Uni-Oldenburg.DE
Real: Joerg Lehners, FB 10 Informatik ARBI, Uni Oldenburg, D-26111 Oldenburg
Unwoerter: Kostensenkung - Gewinnmaximierung - billig, billig, billig
Technical Details
Message-ID:
<5iu5m8$348@news.Informatik.Uni-Oldenburg.DE>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.sys.sun.apps.mbox.zip!not-for-mailReferences:
<5ifodh$1m0$1@lios.apana.org.au>Show Full Headers
Complete Article Headers
Message-ID: <5iu5m8$348@news.Informatik.Uni-Oldenburg.DE> Subject: Re: Cleaning out news spool directories after changing expire.ctl Date: Mon, 14 Apr 1997 00:00:00 +0000 From: "Joerg Lehners" <Joerg.Lehners@Informatik.Uni-Oldenburg.DE> References: <5ifodh$1m0$1@lios.apana.org.au> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.sys.sun.apps.mbox.zip!not-for-mail X-Deja-AN: 234885700 Organization: C. v. Ossietzky Universitaet Oldenburg - Fachbereich Informatik Newsgroups: news.software.nntp,comp.sys.sun.apps