🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
7 messages
7 total messages Started by Brian Murrell Mon, 23 Jun 1997 00:00
Identifying stale news groups?
#18736
Author: Brian Murrell
Date: Mon, 23 Jun 1997 00:00
14 lines
954 bytes
Anybody got any good tools for identifying a stale news group?  I want
to make the size of my spool smaller (i.e. less directories for innd to
search through) by nuking any stale newsgroups.

Any ideas?

-- 
Brian J. Murrell                                 Brian_Murrell@bctel.net
BCTel Advanced Communications                            brian@ilinx.com
Vancouver, B.C.                                         brian@wimsey.com
604 454 5279

Re: Identifying stale news groups?
#18599
Author: Net Scum
Date: Mon, 23 Jun 1997 00:00
31 lines
1760 bytes
On Mon, 23 Jun 1997, Brian Murrell wrote:

> Anybody got any good tools for identifying a stale news group?  I want
> to make the size of my spool smaller (i.e. less directories for innd to
> search through) by nuking any stale newsgroups.

    Here's what I did...
- Sort your active file in reverse order.
- convert group names to paths.
- do a rmdir -p on each directory.

If the directory is not empty (group is active, for certain definitions of
active), rmdir will fail.  The -p flag will remove as many parent
directories as possible.  Doing it in reverse means you'll try to zap
alt.dinosaur.barney.die.die.die before trying to zap alt.dinosaur.barney,
thus clearing any subdirectories first.

This went pretty fast.  You'll miss any groups no longer in your active
file (perhaps makeactive could help here), but I watched as a good number
of directories were nuked pretty quickly.

I'm sure Joe G will pipe in with some useful tool, but I just wanted
something quick and simple.


Barry Bouwsma, ye ole News Bully
http://www.netscum.net/bouwsmb0.html


Re: Identifying stale news groups?
#18638
Author: Simon Lyall
Date: Tue, 24 Jun 1997 00:00
22 lines
1388 bytes
Brian Murrell <brian_murrell@bctel.net> wrote:
>Anybody got any good tools for identifying a stale news group?  I want
>to make the size of my spool smaller (i.e. less directories for innd to
>search through) by nuking any stale newsgroups.

# find /var/spool/news/ -type d -links -3 -mtime +60

Gets all those directories where nothing has been changed for over 60
days. Check this before you pipe it to anything though since things like
news.announce.important and the in.coming directory might be included.

This might take a while on a large spool to run. You could try running it
on the overview tree but you will miss groups that have never had an
article posted to them.

-- 
Simon Lyall. | Looking for Work | Mail: simon@darkmere.gen.nz
"Inside me Im Screaming, Nobody pays any attention."  |  MT.


Re: Identifying stale news groups?
#18677
Author: Brian Murrell
Date: Tue, 24 Jun 1997 00:00
28 lines
1468 bytes
Net Scum wrote:
> 
>     Here's what I did...
> - Sort your active file in reverse order.
> - convert group names to paths.
> - do a rmdir -p on each directory.

I thought of something like that.  Finding empty directories is not
really a big deal, but I didn't want to nuke the directory of a usually
active, but currently empty newsgroup.  Although, I wonder if that is
really a concern.  I seem to recall that INN creates directories for
newsgroups if they are not there.  Am I recalling that correctly?

Hmmmm.  Something to think about.  Thanks a lot for the suggestion.

b.

-- 
Brian J. Murrell                                       
Brian_Murrell@bctel.net
BCTel Advanced Communications                                  
brian@ilinx.com
Vancouver, B.C.                                               
brian@wimsey.com
604 454 5279

Re: Identifying stale news groups?
#18734
Author: Grant Reaber
Date: Wed, 25 Jun 1997 00:00
26 lines
1554 bytes
In article <33B00766.5208@bctel.net>,
Brian Murrell  <brian_murrell@bctel.net> wrote:
>Net Scum wrote:
>> 
>>     Here's what I did...
>> - Sort your active file in reverse order.
>> - convert group names to paths.
>> - do a rmdir -p on each directory.
>
>I thought of something like that.  Finding empty directories is not
>really a big deal, but I didn't want to nuke the directory of a usually
>active, but currently empty newsgroup.  Although, I wonder if that is
>really a concern.  I seem to recall that INN creates directories for
>newsgroups if they are not there.  Am I recalling that correctly?
>
>Hmmmm.  Something to think about.  Thanks a lot for the suggestion.

Wouldn't you want to remove the groups from the active file, too?  And
anyway, a lot of "stale" groups (i.e. groups nobody feeds us) actually
do have articles -- crossposts.

Grant


Re: Identifying stale news groups?
#19291
Author: Hugh Messenger
Date: Tue, 15 Jul 1997 00:00
16 lines
911 bytes

On Tue, 24 Jun 1997 10:44:06 -0700, Brian Murrell
<brian_murrell@bctel.net> wrote:

> I seem to recall that INN creates directories for
>newsgroups if they are not there.  Am I recalling that correctly?

Yes.

>Brian J. Murrell                                       

   -- hugh


Re: Identifying stale news groups?
#19294
Author: Jeff Garzik
Date: Tue, 15 Jul 1997 00:00
101 lines
3365 bytes
This is a multi-part message in MIME format.

--------------DB3D9B31138DDE33F642CAB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

(copy cc'd to author)

Brian Murrell wrote:
> I seem to recall that INN creates directories for
> newsgroups if they are not there.  Am I recalling that correctly?


Yep.  I use this script to keep my spool clean.  I run a fairly unique
expiration policy, where my default policy is

	*:A:0.2:0.2:0.2

...and then I un-specify hierarchies that are actually read.  This lends
itself to a lot of empty directories.  I run the script once a week
(along with fixhist, find-missing.pl, and the other INN janitors) to
remove junk like the sexzilla groups, which get newgrouped, then never
get any posts except spam.
-- 
Jeff Garzik					   Quality news feeds
News Administrator		       INN Technical info, Consulting
Spinne, Inc.				http://www.spinne.com/usenet/

--------------DB3D9B31138DDE33F642CAB
Content-Type: text/plain; charset=us-ascii; name="remove-empty-dirs.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="remove-empty-dirs.pl"

#!/usr/local/bin/perl
#
# find-empty-dirs -- find empty news spool directories and remove em
#
# Jeff Garzik <jgarzik@pobox.com>
#

$SpoolDir = '/var/news/spool/articles';

$start_time = time;
$removed = 0;

&remove_empty($SpoolDir);
$elapsed = time - $start_time;
print "find-empty-dirs: $removed dirs removed, $elapsed seconds\n";
exit(0);

sub numerically { return $a <=> $b; }

sub remove_empty {
  my ($dir) = @_;
  my (@files, $fn, @pos, $i);

  # DEBUG statement
  # print "DIR: $dir\n";

  if (!opendir(DIR, $dir)) {
    print STDERR "Cannot open $dir: $!\n";
    return 0;
  }
  @files = readdir(DIR);
  close(DIR);

  return 1 if (($#files == 1) &&
               (($files[0] eq ".") || ($files[0] eq "..")) &&
               (($files[1] eq ".") || ($files[1] eq "..")));

  foreach $i (0 .. $#files) {
    next if ($files[$i] =~ /^\d+$/);
    next if ($files[$i] =~ /\./);

    if ((-d "$dir/" . $files[$i]) && (&remove_empty("$dir/" . $files[$i]))) {
      if (rmdir("$dir/" . $files[$i])) {
        $removed++;
        print "REMOVED: $dir/", $files[$i], "\n";
        push(@pos, $i);
      } else {
        print STDERR "Cannot remove $dir: $!\n";
      }
    }
  }

  foreach $i (reverse sort numerically @pos) {
    splice(@files, $i, 1);
  }

  return 1 if (($#files == 1) &&
               (($files[0] eq ".") || ($files[0] eq "..")) &&
               (($files[1] eq ".") || ($files[1] eq "..")));

  return 0;
}

--------------DB3D9B31138DDE33F642CAB--


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads