The
code is shown for batch files that create the necessary log file,
update or create the AWStats database, and create daily, weekly, or
monthly reports on your computer.
Several batch files are shown here which are a culmination of the lessons so far.
The batch file, make-daily-reports.bat, can handle spaces in the LOCALPATH directory name.
@echo off set LOCALPATH=d:\dev\awstats rem rem create access.daily.log rem cd "%LOCALPATH%\daily" "%LOCALPATH%\mytools\gzip.exe" -dfvc access.log.*.gz > "%LOCALPATH%\daily\access.daily.log" rem rem create weekly traffic report rem perl "%LOCALPATH%\wwwroot\cgi-bin\awstats_buildstaticpages.pl" -config=daily -update -awstatsprog="%LOCALPATH%\wwwroot\cgi-bin\awstats.pl" -dir="%LOCALPATH%\daily"
The batch file, make-weekly-reports.bat, can handle spaces in the LOCALPATH directory name.
@echo off set LOCALPATH=d:\my dev\awstats set month=12 set year=2008 rem rem create access.weekly.log rem cd "%LOCALPATH%\weekly" "%LOCALPATH%\mytools\gzip.exe" -dfvc access.log.*.gz > "%LOCALPATH%\weekly\access.weekly.log" rem rem create weekly traffic report rem perl "%LOCALPATH%\wwwroot\cgi-bin\awstats_buildstaticpages.pl" -config=weekly -update -awstatsprog="%LOCALPATH%\wwwroot\cgi-bin\awstats.pl" -dir="%LOCALPATH%\weekly" -month=%month% -year=%year% cd "%LOCALPATH%\mytools"
The batch file, make-monthly-reports.bat, can handle spaces in the LOCALPATH directory name.
@echo off set month=11 set year=2008 set LOCALPATH=d:\dev\awstats rem del /Q "%LOCALPATH%\monthly\*.*" rem rem create combined log from several weekly logs rem cd "%LOCALPATH%\merge" "%LOCALPATH%\mytools\gzip.exe" -dfv access.log.*.gz perl "%LOCALPATH%\wwwroot\cgi-bin\logresolvemerge.pl" "%LOCALPATH%\merge\access.log.*" > "%LOCALPATH%\monthly\access.month.log" rem rem create monthly traffic report rem perl "%LOCALPATH%\wwwroot\cgi-bin\awstats_buildstaticpages.pl" -config=%month%.%year% -update -month=%month% -year=%year% -awstatsprog="%LOCALPATH%\wwwroot\cgi-bin\awstats.pl" -dir="%LOCALPATH%\monthly" rem rem delete access logs rem rem del /Q "%LOCALPATH%\merge\*.*"Log Creation Online
Next: Analyze AWStats traffic reports