The programs in the logging directory were created by Mike Vore.
I find them valuable; I hope you do too. Here are Mike's comments on them.

-------------------------------------------------------------------------
GNLOG.2.PL was written to satisfy requests for statistics from our
(fedix.fie.com) (small) gopher server running John Franks' 'gn'
gopher/httpd server.  Our needs in the reporting of gopher stats may
be different from others, but then everyone will have differing needs.
The program is written in perl, so any customization will be
(relatively) easy.  Currently each phase of the process is written to
a seperate file - and most output is complete- however following the
example set in the output of the host information, where gnlog.2.pl
currently sends the list to sort -r | head -20 to get a "top-20" list,
the same can be done for each of the other reports.  Or possibly
sending the file list to `tail -10` to get the bottom 10 (or whatever)
to see what files can be gotten rid of.  Let me know of
changes/additions/improvements so they could be incorporated in the 
next release.    

One caveat - this only works on the log output by gn version 2.* - not 
version 1.*.  A simple perl script can be written (no I don't have it
handy now) to convert the older logs to a form to be used by gnlog.2.pl,
but I have done it - the report is not complete, but counts of files, and 
hosts can be retrieved.



Here my notes for gnlog.2.pl - should go into a 'readme.doc' or 'man
page', when I get more time and feedback.

Mike Vore - mvore@digex.net
         


There are two programs in this package:
   gn_date.pl  - to generate a shell program that will grep for each day
      of the month and pipe it to gnlog.pl.  This program will take two
	  parameters - the month to process, and the file to log file to
	  process.  The month can be of two forms.  If the month is the
	  3-letter month name - it will use it.  If the month is the numeric
	  value of the month (like from `date "+%m"`) gn_date subtracts one
	  from the input value to use the previous month.
	  The reason for the previous month is that I am processing the
	  previous month from a cron job starting at midnight on the first
	  day of the next month.

   gnlog.2.pl   - the real meat of the process.  All input to gnlog is
      taken from STDIN - makes it quite versitle - filter the input thru
	  grep for any specific date (or what ever one wants to look for.)
          gnlog.2.pl needs to be customized - only one line- $gopher_dir
	  _must_ be changed to point to your gopher's home dir.  Failing to
	  do this will cause the file download stats to indicate 0 bytes
	  sent.  Another line near the top ($fedix = 0 or 1 )  tells the
	  program to output the text portion of the summary file in a comma
	  delimited format - we read that into dBase for reporting.

	  The output of gnlog.pl is in 6 files per run (per
	  day/month/(whatever grep filtered input).  They are for:
		 summary
		 hosts
		 text
		 words searched
		 menus 
		 errors
      They do not get too large here, but one month daily run will
	  result in 180+- files.



On a Sparc-2 here running the entire monthend stat package takes 2:24
(min:sec) (most of that time is spent on other stats) so unless you 
have a _very_ slow system it should not cause major headaches. 

**********************
Here is a portion of my 'makemonth' file - 
generated by `gn_date.pl Dec gn72.old`

#! /bin/sh
#
#  to run gnlog.2.pl 
#
grep "Dec  1"  gn72.old | gnlog.2.pl
grep "Dec  2"  gn72.old | gnlog.2.pl
grep "Dec 30"  gn72.old | gnlog.2.pl
grep "Dec 31"  gn72.old | gnlog.2.pl

***********************
and here is the shell that my cron job runs setting up the whole thing.

#! /bin/csh
#
#   monthly logging - automated for overnight use
#  move gopher log
#
cd /online/gopher/log
cp gn72  gn72.old                  <<<< to become a `mv` after it's
                                        first run proves correct
#
#  Now that all files are safe - go back and start working on them
#
#   GOPHER
#
cd /online/gopher/log
gn_date.pl `date "+%m"`gn72.old > makemonth
#
sh makemonth
#

