🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #21320

Re: Articles not being removed

#21320
From: Rahul Dhesi
Date: Sat, 06 Sep 1997 00:00
42 lines
2267 bytes

I normally do something like this once every few months:

   find `cat List` -type f -mtime +60 -print | xargs rm -f

where List contains the top-level directories that I want to traverse.
(It excludes local group hierarchies that I may want to keep for a long
time).

Other solutions to find orphan postings make for technically interesting
challenges, but the above seem to be simple and it works.  If I'm in the
mood I will sort and fastrm the output, but the number of orphaned
articles (usually caused when a filesystem became full and history
entries are corrupted; or if the articles have bad message-ids that are
lost when fixhist is run) usually isn't big enough to be worth it.

I also keep around a little program I call bsort (batched sort):

   #! /some/path/perl
   # tested only with perl 4.036
   # Rahul Dhesi <dhesi@bsort.boxmail.com>
   $LIMIT = shift || 2000;
   $count = 0;
   while (<>) { push(@list, $_); if ($count++ > $LIMIT) {
	 @out = sort @list; @list= (); print @out; $count = 0; } }
   if (@list > 0) { @out = sort @list; print @out; }

It sorts input to output in $LIMIT-line pieces and is good for
optimizing unlinks and other operations without collecting the entire
input stream and without needing temp disk space.  It's also good for
sorting outgoing batches for backlogged sites, thus speeding up
filesystem accesses, without completely losing the FIFO ordering of the
batched filenames.

A nice pipeline would then be:

   find `cat List` -type f -mtime +60 -print | bsort | xargs rm -f
-- 
Rahul Dhesi <dhesi@spams.r.us.com>

Technical Details
Message-ID: <5us89s$rrp$1@samba.rahul.net>
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
References: <3410666B.554F@fcmc.com> <5urcqs$r92$1@bigred.inka.de>

Show Full Headers
Complete Article Headers
Message-ID: <5us89s$rrp$1@samba.rahul.net>
Subject: Re: Articles not being removed
Date: Sat, 06 Sep 1997 00:00:00 +0000
From: c.c.eiftj@87.usenet.us.com (Rahul Dhesi)
References: <3410666B.554F@fcmc.com> <5urcqs$r92$1@bigred.inka.de>
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: 270314338
Organization: a2i network
X-Comment: Encoded From: line allows replies that preserve original subject
NNTP-Posting-User: dhesi
Newsgroups: news.software.nntp