From: Geert J. <gj...@us...> - 2002-09-03 19:40:55
|
Update of /cvsroot/woc/woc/src/woc/src/lire In directory usw-pr-cvs1:/tmp/cvs-serv23171/woc/src/lire Added Files: Makefile.am report.pl report.pl.in Log Message: --- NEW FILE: Makefile.am --- bindir=${prefix}/bin/lire bin_SCRIPTS = \ report.pl CLEANFILES = $(bin_SCRIPTS) --- NEW FILE: report.pl --- #! /usr/bin/perl -w use strict; use diagnostics; # these parameters can be customized #my $EMAIL = "woc\@sci.kun.nl"; my $EMAIL = "egonw\@sci.kun.nl"; my $TMPLOG = "/tmp/woc/woc.log"; my $WOCLOG = "/tmp/woc/woc"; my $LIRE = "no"; my $LIRE2 = "no"; my $WEESLOG = "/vol/www/wees/httpd/logs"; if ($LIRE eq "") { print "System is lacking a working Lire system\n"; exit(1); } my @reports = (); my @titles = (); push(@reports, "grep woc"); push(@titles, "Complete file"); # BELOW IS NOT WORKING PROPERLY #push(@reports, "grep items/"); #push(@titles, "item/*.shtml only"); #push(@reports, "grep cgi-bin-woc | sed -e 's/\?[^\s\"]*//g'"); #push(@titles, "cgi-bin scripts only"); #push(@reports, "grep translation"); #push(@titles, "translation/ only"); print "Extracting information on /woc server...$/"; `/usr/local/gnu/bin/gunzip -c $WEESLOG/access_log.?.gz 2> /tmp/woc/run.log | grep "woc" | cut -f 1,3- -d' ' > $TMPLOG`; my $titel = "WOC Week Statistieken"; if (-r $TMPLOG) { for (my $i=1; $i<=scalar(@reports); $i++) { print "Compiling report $WOCLOG$i.txt (with $reports[$i-1])...\n"; my $command = "cat $TMPLOG | $reports[$i-1] | $LIRE $LIRE2 www combined > $WOCLOG$i.txt"; print "$command\n"; `$command`; if (-r "$WOCLOG$i.txt") { `cat $WOCLOG$i.txt | /usr/ucb/mail -s '$titel $titles[$i-1]' $EMAIL`; } } `rm $TMPLOG`; `rm $WOCLOG*`; } else { print "Cannot find ${TMPLOG}!"; exit(1); } --- NEW FILE: report.pl.in --- #! @PATHTOPERL@ -w use strict; use diagnostics; # these parameters can be customized #my $EMAIL = "woc\@sci.kun.nl"; my $EMAIL = "egonw\@sci.kun.nl"; my $TMPLOG = "/tmp/woc/woc.log"; my $WOCLOG = "/tmp/woc/woc"; my $LIRE = "@PATHTOLIRERUN@"; my $LIRE2 = "@PATHTOLIREL2R@"; my $WEESLOG = "/vol/www/wees/httpd/logs"; if ($LIRE eq "") { print "System is lacking a working Lire system\n"; exit(1); } my @reports = (); my @titles = (); push(@reports, "grep woc"); push(@titles, "Complete file"); # BELOW IS NOT WORKING PROPERLY #push(@reports, "grep items/"); #push(@titles, "item/*.shtml only"); #push(@reports, "grep cgi-bin-woc | sed -e 's/\?[^\s\"]*//g'"); #push(@titles, "cgi-bin scripts only"); #push(@reports, "grep translation"); #push(@titles, "translation/ only"); print "Extracting information on /woc server...$/"; `/usr/local/gnu/bin/gunzip -c $WEESLOG/access_log.?.gz 2> /tmp/woc/run.log | grep "woc" | cut -f 1,3- -d' ' > $TMPLOG`; my $titel = "WOC Week Statistieken"; if (-r $TMPLOG) { for (my $i=1; $i<=scalar(@reports); $i++) { print "Compiling report $WOCLOG$i.txt (with $reports[$i-1])...\n"; my $command = "cat $TMPLOG | $reports[$i-1] | $LIRE $LIRE2 www combined > $WOCLOG$i.txt"; print "$command\n"; `$command`; if (-r "$WOCLOG$i.txt") { `cat $WOCLOG$i.txt | /usr/ucb/mail -s '$titel $titles[$i-1]' $EMAIL`; } } `rm $TMPLOG`; `rm $WOCLOG*`; } else { print "Cannot find ${TMPLOG}!"; exit(1); } |