There is in fact a method to use dates dynamically with NT. The following
code uses batch commands to find the current date which is then parsed with
the separate DAY/MONTH/YEAR portions assigned to environmental variables.
These variables can then be incorporated into various batch file commands.
The code is:
REM **************** Determine report period ********************
For /f "tokens=2" %%I in ('date /T') Do @set x=%%I
For /f "tokens=1 delims=/" %%I in ("%x%") Do @set x1=%%I
For /f "tokens=2 delims=/" %%I in ("%x%") Do @set x2=%%I
For /f "tokens=3 delims=/" %%I in ("%x%") Do @set x3=%%I
@set YEAR=%x3%
@set MONTH=%x1%
@set DAY=%x2%
REM **************** End of code ********************************
I've recently automated the entire Analog process to run my reports for all
my Web sites. A summary of the steps follows:
1. Archive days log files at midnight.
2. Use Windows AT command and scheduler to kick off a batch file
(run1st.bat) to start Analog.
(I use WinAT to automate the AT command process. It runs every morning
following the log file archiving.)
3. The first batch file calls a second batch file (RUNSTATS.BAT) where
batch file and Analog screen output are diverted to a text file. The text
file is used to troubleshoot any problems that may have occurred during the
report run.
4. Second batch file copies log file, then runs a month-to-day report.
Next it runs a year-to-date report. To save space the month-to-day report
outputs to both HTML and to a cache file. The year-to-day report uses each
month's cache file to produce it's report.
5. Finished HTML reports are then copied to a location where they can be
viewed via a Web browser.
As a courtesy I've attached a copy of both batch files. They are a work in
progress so some elements are not quite finished.
**** DISCLAIMER ****
Anyone is free to use these two batch files at your own risk. I cannot take
responsibility for any problems you may encounter.
**** END OF DISCLAIMER ****
Until you are completely comfortable with their operation you should make
backup copies of all files used in the process. The batch files will need
to be modified to reflect the actual environment in which they will run.
I'm not an expert on writing batch files so if anyone has any suggestions on
improving these I'm open to suggestions. TIA.
HTH,
Ed Kabat
Web Platform Engineering Team (WPET)
Infrastructure Services Organization (ISO)
Defense Finance and Accounting Service (DFAS)
[EMAIL PROTECTED]
317-510-5872
DSN 699-5872
-----Original Message-----
From: Jeremy Wadsack [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 13, 1999 11:51 AM
To: [EMAIL PROTECTED]
Subject: Re: [analog-help] Help on batch file
You can use the %Y%m feature in Analog 3.3 to name the output file based on
the
date. There is now way (that I know of) to tell NT to use dates as a
filename.
HTH,
--
Jeremy Wadsack
OutQuest Magazine
a Wadsack-Allen publication
Adrian Illetschko wrote:
> Hi everyone,
>
> I am running analog on a NT server, and I'm using a batch file to run
analog
> automatically every month. Until now I wrote a batch file for each month
to
> use the right logfile and outfile. But now I would like to use one batch
> file to automatically uses the right log- and outfile according to date.
But
> I have no experience at all with batch files, so I can't get it work.
> At the moment it looks like:
>
> d:
> cd \analog
> analog +gfr.cfg d:\logfiles\ex9905.log +Od:\stats\frstat9905.html
>
> How can I change the dates automatically every month?
>
> Thanks for your help,
> Adrian
>
> ------------------------------------------------------------------------
> This is the analog-help mailing list. To unsubscribe from this
> mailing list, send mail to [EMAIL PROTECTED]
> with "unsubscribe analog-help" in the main BODY OF THE MESSAGE.
> List archived at http://www.mail-archive.com/[email protected]/
> ------------------------------------------------------------------------
------------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe analog-help" in the main BODY OF THE MESSAGE.
List archived at http://www.mail-archive.com/[email protected]/
------------------------------------------------------------------------
runstats.bat
run1st.bat