AWStat results in all 0 stats - batch-file

I am trying to get awstat to build html pages from my log files. My log files are created in 'C:\inetpub\stats\awstats-7.3\wwwroot\sites\itsMe_LOGS'. When I run AWStat, I get no errors, it creats a combined.log and it creates about 22 html files that look like this:
I'm not sure what is going wrong but i know that there are proper logs, and the site is active. If there is any other details that would help solve this problem, please let me know so I can add it. Any point in the right direction would be helpful. Thank you.
Batch file
::set up base configurations for itsMe
SET HOST_CONFIG=itsMe
SET BASE_DIR="C:\inetpub\stats\awstats-7.3\wwwroot"
echo Combining log files for .%HOST_CONFIG%
call perl %BASE_DIR%\tools\logresolvemerge.pl -showsteps %BASE_DIR%\sites\%HOST_CONFIG%\*.log > %BASE_DIR%\sites\%HOST_CONFIG%\combined.log
echo Updating statistics for .%HOST_CONFIG%
call perl %BASE_DIR%\cgi-bin\awstats.pl -config=%HOST_CONFIG% -update
echo Generating reports for .%HOST_CONFIG%
call perl %BASE_DIR%\cgi-bin\awstats.pl -config=%HOST_CONFIG% -output -staticlink > wwwroot\sites\%HOST_CONFIG%\awstats.%HOST_CONFIG%.MAIN_SUMMARY.html
call perl %BASE_DIR%\tools\awstats_buildstaticpages.pl -awstatsprog=%BASE_DIR%\cgi-bin\awstats.pl -config=%HOST_CONFIG% -update -dir=wwwroot\sites\%HOST_CONFIG%

The way that AWStats was running, It was producing html pages with a broken directory to the combined.log file. The way I tracked it down was i tried moving my combined.log file into my html page directory and ran my batch file again. In the long run, I needed to change the directory where my combined.log file get's produced.

Related

Post-commit-hook in Subversion doesn't work as I want

i came across a problem with subversion at my work. I want to create a post-commit-hook (post-commit.bat file) command that creates information about the last transaction.
The code looks like this:
#echo off
set file="D:\mypath\logfile%2.txt"
svn log D:\'my path to repro'\ -r %2 -v > %file%
The %2 corresponds to the last revision number. It creates the file with the correct number and tries to write in it. But then the commit hangs and the file remains open. The curious thing is, if I manually trigger the command with a valid revision number, then the whole thing works. Only with the hook it hangs and it also does not commit the files.
Can anyone help me or have any ideas for my problem?
I found a solution, maybe this might be helpful for some person.
I used the wrong command "log". Instead you have to use "svnlook changed..." on the server to get the latest information about the last commit.

How to randomize file order on folders with a batch file

am trying to get a batch file to help me randomize files.
Files are videos/music/text/doc
To be more specific, lets say am having the following files on a folder named like this:
3020_1
3020_2
3020_3
3020_4
3020_5
6031_1
6032_2
5013_1
6060_1
Windows will sort them as above, and i would like to get a folder with the above files to appear randomly.
Can you guys help me out :)
I am sure you are aware of the fact that the order of appearance of files in a Windows folder depends on the sort option you have chosen. Assuming you still want to do this in a given sorted view and you are OK renaming files, you can try the ren command to do this. Find more details here
ren 3020_1 3020_2
Since you want this to be random, you will have to add a bit of logic to get a random file name.
%RANDOM% will give you a random number every time you execute it. More information on that is available here
Hope this gets you move further

Word default folder is different when started programmatically

We have a 2 step process that collects all filenames from a folder into a Word document for use elsewhere.
The original process was to run an old DOS batchfile that collected the filenames into a DOS .txt. Then we launched a Word .docx with a macro that imported the .txt and massaged the formatting. After visual inspection we hit ‘Save’ and that was it.
I had the bright idea that a step could be taken out by launching Word directly from the batch, so I inserted the line: start winword filename. This works great except that the default location that Word wants to save in is now my Templates folder. Running it the old way still works perfectly.
The question is: why is the default location changed by launching Word programmatically and how can it be forced back to the correct location?
Thanks
you can use:
start /D C:\path\to\folder "" winword.exe
this program starts winword.exe and save all files to C:\path\to\folder
ill assume that winword.exe is in the current directory.
for help with the start command : http://ss64.com/nt/start.htm
I investigated the start command, but never did figure out why it operated differently. The eventual solution was to include the Save action in the macro. I still don't know why we didn't have to do that before, but it works now so we're declaring success and moving on.

one log file for several batch processes locks up

I have very basic batch file knowledge. My first script was something I found to export Oracle Discoverer reports via windows task scheduler. That's basically all I know, I've got several of them (maybe 40 or so) that run at various times, some every 30 mins. They sometimes overlap in time.
My issue is not the specific discoverer export, but the logging of errors. I want to log everything to a single log file... with excel and access processes, I can loop until free and all is good; with the discoverer batch files, the log file gets locked at the beginning and doesn't let anything else log in until done. Some of these discoverer reports may take 30 mins or more, messing up all my runs.
Here's an example of my bat file:
#echo off
echo my process %date% %time% >>c:\test.log
c:\orant\DISCVR4\DIS4USR.EXE /connect MyUserID/MyPassword#myserver /open "c:\DiscoReport.DIS" /export xls "c:\MyFile.xls" /batch 1>>c:\test.log 2>>&1
I have a bat file with several of those individual process bat files, so that they run one at a time. That works fine. But when the run takes longer than estimated, then the next run fails... because they all start by running disco, and the log file is locked throughout and until the end... Is there something I can do to just open and close it right at the time of adding the results only?
I've looked for answers, and I believe there's something that might be done with the TEE or redirecting the results maybe to null and then using that as input piped to write to the log? but I don't really know how to do this... looked, tried, weeks and weeks, can't get anything working... Pretty please, I'm sure those who know, can do this with one single line.. Pls help...
Essentially, NO - if you want the log file to contain all events in time-order.
You could have the discoverer processes create their individual logfiles and then
type discoverer.log.file >>logfile
del discoverer.log.file
which would group all of the discoverer process output together in the logfile.
Otherwise, you'd have to put up with more than one log.
I severely doubt TEE could do it as TEE would then itself need to hold the log open, so you're back at the start - But I'll emphasise I haven't tried it.

Installing exe through batch file

I am trying to install through batch file..
ECHO OFF
ECHO Installing MySoftware . . .
"%~dp0\MySoftware.exe" /S /v/qn"UPGRADEADD=link goes here"
pause
but it fails to install.
Not much info to go on. What you have will not work if executed from a UNC drive and may not work if you 'Run as administrator' because the current directory gets changed. Try this. Of course that may not fix it and further details would be nice.
#ECHO OFF
PUSHD "%~dp0"
ECHO Installing MySoftware . . .
"MySoftware.exe" /S /v/qn"UPGRADEADD=link goes here"
Adding to my answer based on comments provided.
Presumably your bat file is in the same folder as MySoftware.exe. If it takes that long, it sounds like the install is working. Try doing
"MySoftware.exe" /?
That may give you a help screen to tell you more about the arguments beng passed. Also, try what you are now doing without the /S (which probably specifies a "silent" install... which is why you don't see anything.
PART 1 - If you want to create a "Setup" File in batch.
Maybe it works, but this is will be very hard to you for done this program.
Let's call the EXE File "Game1:
I will recommend you to take all the Game1 file's code (Maybe you can use the program Notepad++ for do this) after you taked Game1's code do this like i writing here
Let's say that the code of Game1 is:
ABC
Copy the code, then go to the batch file.
The "Setup" file of Game1 HAVE to come with a empty EXE file.
You can make a empty EXE file with notepad - just save the file as:
Name.exe
Then you doing at the batch file script this thing:
set %something%=ABC
After you done this you adding this to the batch script:
Echo %something% >> Name.exe
Don't forget to name the EXE file at the name of the program / game.
And now, if this message didn't help to you, maybe you need to make a EXE from batch file.
PART 2 - If you want to make an EXE file of batch file.
Open the start menu of Windows and search this:
IExpress
Don't let the computer search for you the full name, its working only if you wtiting the full name.
After you search IExpress, click on "Activate Command".
Click on Next, Don't change the first options.
Click on "Extract files only" and click on Next.
Name the EXE program and click Next.
Stay on "No prompt." and continue.
Now you can display a program License. if you want do a txt file and choose the display option.
Add batch files and click Next.
click on the option you want and click Next.
If you want a finish message, click on display message and write the message.
Here browse where the EXE will be and choose your options, click Next.
click Next.
Wow that's was super-long! Hope I helped you!

Resources