Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Apr 1997 05:39:30 -0700
From:      "Jordan K. Hubbard" <jkh@time.cdrom.com>
To:        Taavi Talvik <taavi@uninet.ee>
Cc:        hubs@FreeBSD.ORG
Subject:   Re: stats?? *whine* :-} 
Message-ID:  <2032.860330370@time.cdrom.com>
In-Reply-To: Your message of "Sun, 06 Apr 1997 15:12:24 %2B0300." <Pine.BSF.3.95.970406150956.18028A-100000@ns.uninet.ee> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Dou you have any scripts which extract relevant statistics and send them
> in uniform way?

Well, assuming that you have a reasonably standard FTP log record, e.g.
lines like this:

Sun Apr  6 10:04:57 1997 1 megillah.demos.su 4606 /.16/FreeBSD/FreeBSD-stable/src/libexec/getty/init.c b _ o a root@megillah.demos.su

Then this will generate a daily download summary:

#!/bin/sh
if [ $? -lt 1 ]; then
        file=/var/log/xferlog.day
else
        file=$1
fi
date=`ls -l $file | awk '{print $6 " " $7 " " $8}'`
echo "FreeBSD downloads over last 24 hours (up to $date) from `uname -n`:"
awk '/XXXsomeplaceXXX\/FreeBSD\/.*\/bin\/bin.aa/ {
        files[$9]++;
}
END {
        for (i in files)
                printf("\t%s\t%4d copies.\n", i, files[i]);
}' $file | sed -e 's;/XXXsomeplaceXXX/FreeBSD/\(.*\)/bin/bin.aa;\1;'

Where "XXXsomeplaceXXX" is the root of your full path to the FreeBSD
directory.

Feel free to use this as a template - it's what I'm using right
now to send ftp.freebsd.org's stats to freebsd-stats@freebsd.org

					Jordan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2032.860330370>