🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #27323

Cleaning up INN's .overview hierarchy

#27323
From: Mike Brudenell
Date: Tue, 31 Mar 1998 00:00
48 lines
2403 bytes
Hi!

I'm running INN and have it configured to store the articles' spool area
and the NOV .overview files in separate trees:

    /var/spool/news/articles/...
    /var/spool/news/over.view/...

Occasionally I like to clean up the articles tree and remove any empty
directories belonging to removed or long-idle newsgroups.  This I do with
a command like this (going off memory, so may not be exactly right!):

    find /var/spool/news/articles -depth -type d -exec rmdir {} \;

This performs a depth-first traversal of the tree and removes any empty
directories, and leaving non-empty ones (because rmdir won't delete a
non-empty directory).

I'd like to do a similar cleanup of the over.view tree as well.  However
this isn't as simple as each directory contains a '.overview' file in
addition to any (possibly redundant) subdirectories.

I suspect a solution would be to use a depth-first walk with a script to
first remove an area's .overview file if and only if it is empty (0
bytes), and then remove the directory if it is now empty.

Can I assume that (after a period of time when a group's articles have all
expired and been deleted) that its .overview file will *definitely* be
empty?

Or should I also try and match up the structure of the over.view tree
against that of the articles tree, and forcibly delete any over.view
directories which don't have a corresponding entry in the articles tree
(even if a non-empty .overview file or sub-directories remain)?

And has anyone already written a script to do this sort of clean up?  :-)

Cheers,

Mike Brudenell
-- 
The Computing Service, University of York, Heslington, York, YO1 5DD, UK
Tel: +44-1904-433811  FAX: +44-1904-433740  http://www.york.ac.uk/~pmb1/

* Unsolicited commercial e-mail is NOT welcome at this e-mail address. *

Technical Details
Message-ID: <pmb1-3103981720210001@pippin.york.ac.uk>
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

Show Full Headers
Complete Article Headers
Message-ID: <pmb1-3103981720210001@pippin.york.ac.uk>
Subject: Cleaning up INN's .overview hierarchy
Date: Tue, 31 Mar 1998 00:00:00 +0000
From: pmb1@york.ac.uk (Mike Brudenell)
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: 339512948
Sender: pmb1@york.ac.uk
Organization: The Computing Service, The University of York, UK
Newsgroups: news.software.nntp