Consultor Eletrônico



Kbase P24445: pccmd doesn't work when started by at scheduler
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/29/2003
Status: Unverified

GOAL:

Why won't AT Scheduler stop a database using pccmd.

FIX:

Some Progress customers report that they are unable to
shut down a database which is server from Proservice/Procontrol
when using the Windows NT Scheduler.

In fact, both the NT Scheduler and ProControl are operating
properly but the commands involved are not being delivered to ProControl.

The Windows Scheduler (either AT.EXE or WinAT.EXE) is somewhat
similar to the cron command in UNIX; it runs commands at
scheduled times. The normal syntax for the AT command is:

AT time "command"

There are a number of options available, see the NT manuals for
details.


In Progress version 8.0 and later, the normal method of using the
NT Scheduler is with PCCMD commands and ProControl. However, remember
that the NT Scheduler first parses the "command" looking for valid NT
commands. If none are found, it then passes the command to the
application.
The following will work as expected:

AT 03:00 PCCMD DATABASE START SPORTS

However, anyone not familiar with the NT Scheduler might be surprised
when the following command does not stop a database:

AT 04:00 PCCMD DATABASE STOP SPORTS

The reason this does not stop the database is that the word STOP is a
reserved NT command. Windows NT parses the command line, encounters
the word STOP and immediately terminates. It does not pass the
command to ProControl and it does not generate an error. (NT believes
that STOP is a valid command so it does not consider this to be an
error.)


To insure that you can start and stop databases at scheduled times,
always place the PCCMD commands inside a batch file. Then the NT
Scheduler command becomes:

AT 04:00 C:\SHUTDOWN.BAT or a similar batch file name

Use of batch files also allows for detection of success or failure of
a command. The batch file can contain many lines, including a test
for ERRORLEVEL of 0 or 1. Progress provides PRO32CTL.BAT and
PRO32SRV.BAT as examples of batch files.


--------------------------------------------------------------------------------