#!/usr/bin/perl

# based on NLANR Cache Logfile Analysis Scripts from http://www.squid-cache.org/Scripts/NLANR/
#
# customised by Martin Pot 2003 for use on Smoothwall Express
# http://martybugs.net/smoothwall/squidlogs.cgi
#
# SmoothWall scripts
#
# This code is distributed under the terms of the GPL
#
# (c) The SmoothWall Team
# run.pl

# define script location
my $dir = '/usr/local/squid-logs';

# define squid log file
my $sqlog = '/var/log/squid/access.log';

# define temp summary file
my $summary = 'summary';

# define report file
my $report = 'report.txt';

system("$dir/access-extract.pl -h < $sqlog > $dir/$summary");
system("$dir/access-extract-urls.pl < $sqlog >> $dir/$summary");
my $date = `date`;
$date =~ s/WST //;
chomp($date);
system("/bin/echo \"   GENERATED: $date\" > $dir/$report");
system("$dir/access-summary.pl < $dir/$summary >> $dir/$report");

