🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Brad Groshok Thu, 27 Mar 1997 00:00
News article count report needed
#16394
Author: Brad Groshok
Date: Thu, 27 Mar 1997 00:00
14 lines
806 bytes
Does anybody have a script to generate a list of the number of
articles that are currently being stored in each group.
and / or 
also list the HD usage per group named.

Just thought I'd ask before I did one myself.

Looking to tune the expire.ctl file a bit.

TIA


Re: News article count report needed
#16433
Author: Ian Stirling
Date: Fri, 28 Mar 1997 00:00
37 lines
2445 bytes
Brad Groshok (brad@odyssey.on.ca) wrote:
: Does anybody have a script to generate a list of the number of
: articles that are currently being stored in each group.
: and / or 
: also list the HD usage per group named.

Something like  (only counts each article once, nomatter how many xposts)
awk -F\\t '{print $3}' history|awk -F/ '{a[$1]++}END{for(x in a)print x" "a[x]}'|sort

and

cd /usr/lib/news
du -S


: 
: Just thought I'd ask before I did one myself.
: 
: Looking to tune the expire.ctl file a bit.
: 
: TIA
: 

-- 
Ian Stirling.                     Currently designing a new PDA, see homepage.
Homepage:                         http://www.mauve.demon.co.uk/
A fight between good and evil, an epic battle. Darth vader and Luke, 
suddenly in the middle of the fight, Darth pulls Luke to him, and whispers
"I know what you'r getting for christmas Luke" Luke exclaims "But how ??!?"
"It's true Luke, I know What you'r getting for christmas"
Luke tries to ignore this, but wrenches himself free, yelling "How could you
know this?", Vader replies "I felt your presents" 



Re: News article count report needed
#16632
Author: Todd D. Taft
Date: Thu, 03 Apr 1997 00:00
23 lines
1589 bytes
In article <333a9cc9.242029281@207.107.112.2>,
Brad Groshok <brad@odyssey.on.ca> wrote:
>Does anybody have a script to generate a list of the number of
>articles that are currently being stored in each group.
>and / or 
>also list the HD usage per group named.

The enh-du package from Dave Barr's INN page has a rather nice script
in it that allows you to generate reports of disk space used per
group, and even how much of the usage is from files that are X days
old.  You get something like this:

newsgroup                         0days   1days   3days   5days   7days  15days
alt.mag.playboy                  333242  297305   77129       0       0       0
alt.binaries.multimedia.erotica  329713  155567       0       0       0       0
alt.binaries.warez.ibm-pc        312296  139048       0       0       0       0
-- 
Todd D. Taft                              taft@cs.unc.edu
WWW: http://www.cs.unc.edu/~taft/         todd_taft@unc.edu
U.N.C. Department of Computer Science Facilities Staff

Re: News article count report needed
#16659
Author: Gary Funck
Date: Thu, 03 Apr 1997 00:00
155 lines
6565 bytes
Brad Groshok <brad@odyssey.on.ca> wrote:
> Does anybody have a script to generate a list of the number of
> articles that are currently being stored in each group.
> and / or 
> also list the HD usage per group named.
> Just thought I'd ask before I did one myself.
> Looking to tune the expire.ctl file a bit.

A while ago, I wrote a program that processes the news history
file, and produces a set of article counts per group as well as
histogram of article counts that will expire at various timeframes.
Since this program reads the history file, it is a good bit faster
than programs that read the full news hierarchy.  Histstats is
derived from C-news sources, but works equally well with INN based
systems.


Histstats can be fetched from:
    ftp://intrepid.intrepid.com/pub/gary/histstats.shar

Hwere's the README file:

   Subject: histstats - print news history file statistics
   Date: May, 3, 1994
   From: Gary Funck (gary@intrepid.com), Intrepid Technology Inc.

Histstats is a program that aids in the maintenance of the Unix
news article spool area. Histstats reads the news article 'history'
database and prints statistics on the total number of articles
filed in each group or hierarchy. Optionally, a form of histogram
is printed, giving the count of articles received at various
time intervals prior to a specified date.

The article counts and histogram produced by histstats can be used
by the news administrator to determine the relative amount of
space consumed by each group or hierarchy.  The histogram can
be used to give feedback on the amount of space that might be
gained by imposing a particular article expiration strategy.

The command summary for 'histstats', extracted from the
'expire' manpage, is given below:

NAME
     histstats - print history file statistics

SYNOPSIS
     /usr/lib/newsbin/expire/histstats [ -g ] [ -v ]
     [ -H history_dir ] [ -F c ] [ -n nnnnn ] [ -d ]

DESCRIPTION

     Histstats scans the history file and prints statistics.  A
     line is printed for each group, and each news hierarchy that
     has one or more articles.  By default, each line in the out-
     put contains the group or hierarchy name followed by the
     total number of articles contained in the group or hierar-
     chy.

     If the -v (verbose) option is given, a line is printed giv-
     ing a form of histogram, listing the number of articles that
     have arrived within various time intervals, based on the
     number of days that have passed since the article was
     received.  Each line gives the group or hierarchy name fol-
     lowed by a series of numbers.  The first number gives the
     total number of articles in the group or hierarchy.  The
     next seven numbers give the total number of articles
     received before today, yesterday, and so on for the past
     week.  The next three numbers give the number of articles
     that arrived two weeks prior to today, three weeks prior to
     today, and one month prior to today.  The last two numbers
     give the number of articles that were received two months
     prior to today, and three months prior to today.

     For example, the default output for the `comp' news hierar-
     chy might appear as follows:

     comp 155021


     If the -v option is given, the output might appear as fol-
     lows:

     comp 155021 145306 145306 141588 131768 122472 115536 108891 101830 60054 10406 3157 2

     where:

        155021 is the total number of articles in the hierarchy
        145306 were received prior to today
        145306 were received prior to yesterday
        141588 were received prior to day before yesterday
        131768 were received prior to 3 days ago
        122472 were received prior to 4 days ago
        115536 were received prior to 5 days ago
        108891 were received prior to 6 days ago
        101830 were received prior to 2 weeks ago
         60054 were received prior to 3 weeks ago
         10406 were received prior to 1 month ago
          3157 were received prior to 2 months ago
             2 were received prior to 3 months ago

     Normally, histstats prints a line for each group or hierar-
     chy.  If the -g option is given, then a line will be printed
     only for groups.  No summary information will be printed for
     hierarchies.

     Histstats accepts a few other switches that are seldom used.
     The -H switch supplies the name of a directory, other than
     /usr/lib/news as the directory containing the `history'
     file.  The -n switch supplies an explicit date to be used to
     calculate the number of days that have passed since an arti-
     cle arrived.

INSTALLATION
------------

Histstats is derived from the C News 'expire' program, and is
built in the cnews/expire directory.  Here are the steps required
to install 'histstats':

1. Login as the news administrator, and 'cd' to the directory
   where the cnews sources are located.  (The C news source
   directory is called 'cnews' in the instructions below.)

2. Copy histstats.c into the cnews/expire source directory.

3. Copy the expire.8 manpage into the cnews/man directory, or
   update the existing expire.8 manpage, using the expire.8.diffs file.

4. Add histstats to the 'THEM' make variable in the cnews/expire Makefile
   as shown below:

    THEM = expire histdups histinfo histslash histstats mkhistory \
	    upact doexpire mkadir recovact expireiflow

5. Add a step in the cnews/expire Makefile to build histstats
   as shown below:

   histstats: histstats.o $(LIBS)
	    $(CC) $(CFLAGS) $(LDFLAGS) histstats.o \
		  $(PRE) $(DBM) $(LIBS) $(POST) -o $@

6. Make 'install' in the neews/expire directory, and in
   the cnews/man directory.

7. Try running histstats by entering the command
   
       % histstats > article.counts

   or
   
       % histstats -v > article.histogram


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