Article View: news.software.nntp
Article #29946Re: Any way to reduce messages in control
From: Jeremy
Date: Tue, 21 Jul 1998 00:00
Date: Tue, 21 Jul 1998 00:00
39 lines
1690 bytes
1690 bytes
Hitesh Patel <hitesh@presys.com> wrote:
> Are there any way's to keep the number of messages in my control.*
> below say 30,000 messages at a time... i'm having problems with the
> number of articles being so huge that it's affecting the performance
> of my server.
This can probably be improved on, but it's been working for me for
a while; it basically gives a group a one-hour expire, and nukes the
overview file for good measure.
#!/usr/local/bin/perl
$directory = "/var/news/spool/control/cancel";
$overview = "/var/news/spool_over/control/cancel/.overview";
$now = time;
chdir $directory;
opendir DIR, ".";
@files = readdir DIR;
closedir DIR;
FILE: foreach $file (@files) {
next FILE if (-d $file);
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,
$mtime,$ctime,$blksize,$blocks) = stat $file;
$age = $now - $mtime;
unlink $file if ($age > 3600);
}
unlink $overview;
--
Jeremy | jeremy@exit109.com
"Never tell me the odds." --Han Solo
Technical Details
Message-ID:
<6p386m$5iv$1@news1.exit109.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.mbox.zip!not-for-mailReferences:
<35B51642.C6D50@presys.com>Show Full Headers
Complete Article Headers
Message-ID: <6p386m$5iv$1@news1.exit109.com> Subject: Re: Any way to reduce messages in control Date: Tue, 21 Jul 1998 00:00:00 +0000 From: jeremy@exit109.com (Jeremy) References: <35B51642.C6D50@presys.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.mbox.zip!not-for-mail X-Deja-AN: 373669319 X-Trace: news1.exit109.com 901063702 5727 208.225.64.3 (21 Jul 1998 23:28:21 GMT) Organization: There Is No Organization NNTP-Posting-Date: 21 Jul 1998 23:28:21 GMT Newsgroups: news.software.nntp