Thread View: news.software.nntp
3 messages
3 total messages
Started by Mike Brudenell
Tue, 31 Mar 1998 00:00
Cleaning up INN's .overview hierarchy
Author: Mike Brudenell
Date: Tue, 31 Mar 1998 00:00
Date: Tue, 31 Mar 1998 00:00
48 lines
2403 bytes
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. *
Re: Cleaning up INN's .overview hierarchy
Author: Dave Barr
Date: Tue, 31 Mar 1998 00:00
Date: Tue, 31 Mar 1998 00:00
30 lines
1466 bytes
1466 bytes
In article <pmb1-3103981720210001@pippin.york.ac.uk>, Mike Brudenell <pmb1@york.ac.uk> wrote: >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? Yes, especially if you periodically run "expireover -s". (or "expireover -a", and you're running at least 1.4unoffsomething). The best way is to just do: expireover -s cd $overviewdir find . -size 0 -print | xargs rm find . -type d -print | xargs rmdir >/dev/null 2>&1 Before you do all this you might also take the time to run a "findmissing" to find any orphan articles. See the findmissing on my INN page if you don't have it already. http://www.cis.ohio-state.edu/~barr/INN.html --Dave -- http://www.cis.ohio-state.edu/~barr/ barr@cis.ohio-state.edu
Re: Cleaning up INN's .overview hierarchy
Author: Jerry Aguirre
Date: Fri, 03 Apr 1998 00:00
Date: Fri, 03 Apr 1998 00:00
47 lines
2897 bytes
2897 bytes
In article <pmb1-3103981720210001@pippin.york.ac.uk>, Mike Brudenell <pmb1@york.ac.uk> wrote: >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? No. Even if you regularly run expireover -s this is not guaranteed. For one thing expireover -s uses your active file as input. If a group is not in the active file then expireover will not even look for an overview file much less clean out old entries. So, for any group you deleted there is the posibility that there is an old .overview file hanging around. The directory and possibly articles may also hang around. Expire should clean out the articles and expireover from the expire output "should" clean out the overview file but nothing is guaranteed. >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)? No, you do NOT want to match overview to article spool. What you DO want to do is match overview to the active file. The active file is the definitive list of groups as far as INN is concerned. Any overview file that does not match an entry in the active file is bogus and useless. So your script should find each overview file and then match to see if "....news/over.view/GROUP/NAME/.overview " corresponds to GROUP.NAME in the active file. After than do the depth first directory deletion. Remember just because a/b/.overvie is invalid does not mean that a/b/c/.overview is not. In many group splits the top group is deleted and replaced by the "misc" group. Whether to delete valid but zero length .overview files is a separate issue. It only wastes an inode. Might save a small amount of time when the first overview entry is added. But a simpler solution to the entire problem might be to just run find on over.view and blow away any files older than N days. Most sites run with a maximum "keep" time anyway so any overview file that is older than that must have bogus information. This will not immediately reclaim every byte but it is a lot simpler to set up.
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