I like to thank Aengus Lawlor for helping me regarding scheduling and
automation of Analog on NT server. After few email communications I finally
managed to make it run.

This was my question: "I want to make analog collect statistic
automatically on specific time."

This is what Aengus has suggested.
>
>You can schedule a job to run using the AT command, and, depending on how
complex your 
>requirements are, a simple 3 line batch file may be sufficient.
>
start at the beginning.

Create a batchfile called c:\temp\test1.bat  with 1 line:

DIR C:\ > c:\at_test.txt

(it doesn't do anything useful, but by creating a simple file it leaves 
a fingerprint that proves that it ran).

Now type 
   AT 16:57 "c:\temp\test1.bat"

This will schedule your batch file to run at 16:57 (or whatever time you 
specify). If you now type just AT on it's own, you should see that the 
job is scheduled to run at 16:57 (or whatever time you entered).

Just after 16:57 check to see if c:\at_test.txt was created. Now you 
have a job running on schedule. (because you didn't specify /every:, it 
only runs once, and is deleted from the schedule - you can practice with 
repeated stuff once you get the basics working).

Now that you've got a handle on the AT command, lets create a batch file 
that does something useful.

Save the 3 lines I gave as automatic.bat in whatever folder is 
appropriate, modifying the directory specs for your circumstances. 

When you run Analog, it will look for analog.cfg in the current 
directory. When you run something with AT, the current directory is 
C:\WINNT\SYSTEM32, so it's a good idea to have a CD command at the start 
of the batch file you are scheduling, because Analog won't be able to 
find it's LANG files if it looks for them in 
C:\WINNT\SYSTEM32\LANG\uk.lng
The second line of the batchfile captures todays date in an environment 
variable, and the 3rd line calls analog pointing to a logfile that is 
named with todays date (IIS calls its daily log files exYYMMDD.log, 
where YYMMDD is the year, month and date for the day the file was 
created).


automatic.bat:
 CD /D x:\folder\Analog
 for /f "tokens=2,3 delims=/ " %%f in ('date /t') do set today=%%f%%g 
 ANALOG y:\folder\ex00%today%.log

Replace x:\folder\ and y:\folder\ with whatever are the appropriate 
locations on your system.

If you create this batch file in c:\temp, for example, then you can run 
it and verify that it works - you may have to make some modifications to 
analog.cfg to get it to do what you want. Once it works manually, then 
you can test it with the AT command, but there's no point scheduling a 
batch file that doesn't work manually.

(I haven't touched on the issue of access control - by default under NT, 
"everyone" has full access to everywhere on the system, so it doesn't 
matter. If your NT machine has been tightened up, scheduled jobs may not 
have the rights they need to access specific resources, so a batch file 
that runs okay manually may still fail when you try to run it under the 
AT command. But you can deal with that if you encounter it).


This is what I did -- I typed the below lines and called automatic.bat
CD /D c:\Analog
 for /f "tokens=2,3 delims=/ " %%f in ('date /t') do set today=%%f%%g 
ANALOG c:\winnt\system32\logfiles\w3svc1\in*.log

After this file was saved as automatic.bat then I run AT command. First I
checked to see  whether automatic.bat command works. I typed C:\> AT 16:55
"c:\automatic.bat" and enter.
When a computer time click at 16:55 analog program is executed and creates
analog output file.

To make Analog on specific time type AT 23:00 /every:m,t,w,th,f,s,su
"c:\automatic.bat"
This should run Analog program at 23:00 every week and creates output file.

Thanks once again to Aengus Lawlor for helping.

-Wangyal
Tsering Wangyal Shawa
Geographic Information Systems Librarian
Digital Map and Geospatial Information Center
Geosciences and Map Library
Guyot Hall, Princeton University
Princeton, NJ 08544
Phone: (609) 258-6804
Fax: (609) 258-1274
www.princeton.edu/~geolib/gis
------------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe" in the main BODY OF THE MESSAGE.
List archived at http://www.mail-archive.com/[email protected]/
------------------------------------------------------------------------

Reply via email to