home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2831 / README.backwater < prev   
Encoding:
Text File  |  1991-02-22  |  2.5 KB  |  57 lines

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