httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mokwena Motseto <Mots...@sapo.co.za>
Subject RE: [users@httpd] Virtual Hosts and Webalizer
Date Thu, 13 May 2004 12:01:00 GMT
Hi

I am trying to configure my webalizer to run every hour and analyze the
logfiles from IIS, i found a batch file that can be run once a day but i am
struggling to change it to run every hour maybe its because i am not good in
scripting

Can you perhaps have a look at it and see if you can help me

Mokwena Motseto
@echo off

rem The directory containing log files
SET LOGDIR=D:\IISLogs\W3SVC1

rem The webalizer home directory
SET WEBALIZERHOME=d:\html\webalizer\

rem The date delimeter character, put a space after the /.
SET DATEDELIM=/

rem Terminate the program if the webalizer home directory is not found
If not exist %WEBALIZERHOME%\ goto END

rem Extract the current date and store as environment variable cdate
rem for /f "tokens=2-4 delims=%DATEDELIM%" %%a in ('DATE /T') do set
cdate=%%c%%a%%b

rem Remove first two digits from cdate, append "nc", add ".log"
set logfile=nc%cdate:~2%.log

echo set logfile=%logfile% > d:\html\webalizer\name_of_website\todaylog.bat

rem Run the webalizer program to generate output files

@call drive:\html\webalizer\name_of_website\todaylog.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer.conf
%logdir%\%logfile%

 

rem Cleanup - clear the environment variables

set logdir=

set webalizerhome=

set datedelim=

set cdate=

set logfile=

 

rem End the program

:END

* For Microsoft IIS using Microsoft IIS Log File Format:

rem Converting the Microsoft IIS Log File Format to NCSA CLF

set convert=in%cdate:~2%.log

set logfileA=%convert%.ncsa

convlog -ii %logdir%\%convert% -o %logdir%

del %logdir%\%logfile%

ren %logdir%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\ppp\todaylog.bat

 

rem Run the webalizer program to generate output files

@call d:\html\webalizer\name_of_website\todaylog.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer.conf
%logdir%\%logfile%

 

rem Cleanup - clear the environment variables

set logdir=

set webalizerhome=

set datedelim=

set cdate=

set logfile=

 

rem End the program
"This e-mail is sent in terms of the following policy/disclaimer. Click on
this link http://www.sapo.co.za/mail_disclaimer.htm to read full
disclaimer."

Mime
View raw message