New
#11
If you read the actual AWS docs, it says "awstats.pl -config=[website domain]"...
This is the complete first block of the batch job. All subsequent blocks are the same, just changing the site name. There are 181 blocks in the batch job.
REM Brookside Stats
z:
cd\webroot\brookside\logs
copy access.log process.log
del /Q brookside.log
del /Q *.tmp
findstr /I "brookside" process.log >process.tmp
findstr /V "reports" process.tmp >brookside.log
cd\awstats\wwwroot\reports
del /Q *.*
c:\perl64\bin\perl z:/awstats/tools/awstats_buildstaticpages.pl -awstatsprog=z:/awstats/wwwroot/cgi-bin/awstats.pl -update -config=brookside -dir=z:/awstats/wwwroot/reports/
z:
cd\awstats\wwwroot\reports
ren awstats.brookside.html index.html
copy *.* z:\webroot\brookside\reports\brookside
Looks fine except -update is before -config which is not what the script reports as "syntax"
Anyway, what's the result of my post #12
The config does equal the website name which is also the name of the config file.
- - - Updated - - -
When this service is restarted Z: is still accessible from both CMD and Explorer as it should be. It has no affect on the batch job failure.
The drive is mapped correctly for the SYSTEM Account and the Local Account at the same time. The most sensitive process dependent on this drive mapping is Apache web server. If the drive was is not mapped for both SYSTEM and Local Account, the web service would not start because it would be unable to find the root directories specified in httpd.conf. Apache server starts fine on all 8 machines. I also have XLight FTP servers which are also dependent on data on Z:. The FTP servers work fine on all 8 machines.
Changing where -update is in the command line did not have an affect. It works on the machines it works on, it doesn't work on the machines that fail.
Everything on my network works exactly as expected and intended except for this one batch file on 5 of the 8 machines.
Regardless of permissions, I see a race condition if you have multiple servers accessing the same \awstats\wwwroot\reports, and running "del *.*" in parallel. Shouldn't each of the domains get their own temp folder, so there's no conflict?
I presume you're scheduling the report simultaneously on all 8 machines.
What doesn't work is my AWSTats report batch file. It works fine on 3 of the 8 machines, two of which are Windows 10.Does not compute.This command line fails on 5 of the 8 machines with a syntax error, but AWStats is not telling me what the error is.
On the surface it seems maybe it's a permission issue. Just for "giggles" add all this crap above your batch code, then manually fire off your batch code and see if the stats and logs are generated.
Just a shot in the dark here. Maybe there's a NetBIOS issue of some sorts.Code:@echo off :: BatchGotAdmin :------------------------------------- REM --> Check for permissions IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" ) ELSE ( >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" ) REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params= %* echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0" :--------------------------------------
*I got said "crap" from StackExchange and it works for me. LOL!