home *** CD-ROM | disk | FTP | other *** search
- No Warranty on this code, use at your own risk.
- Written 1991.02.21 Dave Mason <mason@tmsoft>
-
- This uses the libraries that come with C news, so B news sites may
- have to do a lot of hacking to make it work.
-
- There has recently (always?) been a problem of the odd site that has
- really bad news connections and eventually passes on news that is so
- old that the Message-ID's are gone from everyone's history file.
-
- This irritated me enough today that I did something about it. On this
- system it didn't make a HUGE change, but it removed about 600K from
- the 25MB that was sitting in the news partition at the time. I
- suspect it would have more effect on systems that don't expire quite
- so aggressively.
-
- This program takes a list of file names on stdin, checks the Date:
- field in each file, checks the date the file was created, and if the
- Date is >10 days older than the modify time, determines that this file
- has taken too long in transit & spits its name on stdout. (If you
- keep more than 10 days in your history file you can run the program
- with the number of days as a parameter.)
-
- Typical usage to clean out all those pesky junk files would be:
- cd /usr/spool/news
- histfiles /usr/lib/news/history |
- backwater 10 |
- xargs rm -f
-
- I looked in expire and relaynews to see if I could get them to do the
- work more easily, but the answer is no. relaynews doesn't even look
- at dates, and expire doesn't look at the files.
-
- The right place to put this is in relaynews (so we don't create the
- file in the firstplace), but that was a little more work and would
- increase its size (since it would require getdate) though it wouldn't
- slow it down (when you didn't want it) if it was made a switch (and
- probably not TOO much even when you did want it). Hence this quick & dirty.
-
- histfiles just extracts filenames from the history file (just the
- first name) replacing `.' with `/'. Although it's an easy hack, it may
- be of some small value on its own.
-
- I put backwater.c in news/c/expire and modified the Makefile (included
- here). I might write a little program to allow you to run backlog
- only on the files that have arrived since the last try (improving on
- ``histfiles''), but I may just make the change to relaynews & send it to
- Geoff.
-
- Final comment: I have not tested backwater with the parameter on the
- command line. The code looks right, but I've put more time into this
- than I can afford already. Buyer beware!
-
- Oh, and thanks Henry & Geoff for making code that's nice & easy to hack.
-
- Hope this helps someone. ../Dave
-