Two NonStop NET/MASTER MS commands enable you to control the time and interval at which other NonStop NET/MASTER MS commands are executed: AT and EVERY. These two commands are referred to as timer commands.
The AT command issues a command or series of commands at a specific time of the day. For example, to start the remote link REMOTE1 at 1:00 p.m., enter:
AT 13:00 CMD=LINK START=REMOTE1
The EVERY command issues a command or series of commands at a specified time interval. For example, to monitor the status of REMOTE1 every 10 minutes, enter:
EVERY :10 CMD=SHOW LINKS=REMOTE1
You can combine the AT and EVERY commands in a single command string to execute a command at a specific time and then at regular intervals. For example, to display all OCS users starting at 12:10 p.m. and at two minute intervals after that for three times, enter:
AT 12:10 CMD=EVERY :02 LIMIT=3 SHOW OCS Attributes of Timer
Commands
By default, timer commands execute only when you are logged on to NonStop NET/MASTER MS.
Timer commands execute under your authority level, even if you route them to be executed under another user ID.
Each timer command has an associated purge ID number, which is displayed in the message display area when you first issue the timer command. For example:
NNM1706 COMMAND ACCEPTED, PURGE ID NUMBER IS 7
Issue a SHOW TIMER command to display information about currently queued timer commands. For example:
SHOW TIMER
NNM1721 ID BY INTERVAL -USERID-R LIM CNT K/P ENV P/M TID NNM1722 7 EV 00:02:00 MGRDEMO 3 2 NO PRI YES OCSUSERS NNM1725 CMD=SHOW OCS
NNM1723 NUMBER OF TIMER COMMANDS DISPLAYED WAS 1
The AT and EVERY timer commands have operands that enable you to do the following:
Determine what happens if you are logged off from NonStop NET/MASTER MS when the scheduled command is ready to be executed (the KEEP operand). Send the command to be executed under the control of another user ID (the ROUTE operand).
Specify how many times the command should be executed at the specified interval (the LIMIT operand).
Issuing Timer Commands
Specify a 1-character to 12-character timer ID that you can use instead of the system-generated purge ID number to explicitly purge timer commands from the
timer queue (the TID operand).
Refer to the NonStop NET/MASTER MS Command Reference Manual for a complete description of these and other AT and EVERY command operands.
The Timer Queue When you issue a timer command to schedule the execution of other commands, the commands are placed in a timer queue. NonStop NET/MASTER MS does not save the timer queue when it shuts down.
Prior to each attempt to execute a command in the timer queue, NonStop
NET/MASTER MS checks that you are still logged on. By default, if you are no longer logged on, NonStop NET/MASTER MS deletes the command from the timer queue.
Executing Timer Commands When You Are Not Logged On
Use the KEEP or ROUTE operand to override the automatic deletion of commands from the timer queue.
Using the KEEP Operand
Include the KEEP operand in your timer command string to specify that the command be executed under the control of either the Background Monitor (BMON) or the
Background Logger (BLOG) if you log off. The BMON and BLOG background processes are discussed in “Executing NonStop NET/MASTER MS Commands in the Background,” later in this section.
For example, the following command string specifies that if you are not logged on to NonStop NET/MASTER MS at 9:00 p.m., the LNKCHECK procedure is executed by BLOG. The results of the procedure are sent to the activity log:
AT 21:00 KEEP=LOG CMD=START LNKCHECK
The KEEP operand only takes effect when NonStop NET/MASTER MS attempts to execute a timer command and determines that you are no longer logged on. If you log on to the system again, the KEEP operand is ignored and normal execution resumes.
Using the ROUTE Operand
You can also use the ROUTE operand in your timer command string to override the automatic deletion of commands from the timer queue when you are not logged on (see “Sending a Timer Command to Another User,” next). Using the ROUTE operand with your user ID (and without specifying a KEEP operand) ensures that the
command is not automatically deleted when you are not logged on and is only executed when you are logged on.
Sending a Timer Command to Another User
The ROUTE operand sends a command for execution under the control of a specified “target” NonStop NET/MASTER MS user. If the target user is not logged on when NonStop NET/MASTER MS attempts to execute the command, NonStop
Issuing Timer Commands
106379 Tandem Computers Incorporated 3–7
Timer commands execute under your authority level, even if you route them to be executed under another NonStop NET/MASTER MS user.
Note Timer commands included in an NCL procedure that executes during system startup execute under the authority level of the NonStop NET/MASTER MS user who is bringing up the NonStop NET/MASTER MS application.
Limiting the Number of Times a Command Is Executed
Include a LIMIT operand in your timer command string to limit the number of times a command executes. A limit counter is incremented each time the command is
executed. After reaching the specified limit, NonStop NET/MASTER MS purges the command from the timer queue.
Note If you include a PMSG=YES operand in your timer command string, a message is displayed when the command is purged from the timer queue.
If you include a ROUTE operand in your timer command string, and the command is not executed because the target user is not logged on, the limit counter is not incremented.
The following example executes the SHOW USERS command every 10 minutes for a total of five times starting at 1:30 p.m :
AT 13:30 EVERY :10 LIMIT 5 CMD=SHOW USERS
To display the limit and the number of times a command has already executed, issue a SHOW TIMER command.
Purging a Timer Command Use the following PURGE commands to explicitly purge timer commands from the timer queue.
Purge all timer commands owned by your user ID by using the PURGE TIMER=OWN command.
Purge all timer commands in the queue by using the PURGE TIMER=ALL command (provided you have sufficient authority).
Purge a particular timer command by using either the user-supplied timer ID or the system-generated timer ID number to identify the command with the PURGE TIMER={ user-timer-ID | system-timer-ID } command.
To purge several individual timer commands, repeat the TIMER operand. For example:
PURGE TIMER=12 TIMER=15 TIMER=OCSUSERS
returns the following confirmation messages in the message display area:
NNM1737 TIMER COMMAND ID NUMBER 12 PURGED NNM1737 TIMER COMMAND ID NUMBER 15 PURGED
NNM1737 TIMER COMMAND ID NUMBER OCSUSERS PURGED
Issue a SHOW TIMER command to display the purge IDs and timer IDs (if assigned) of all commands in the timer queue.
System-Wide Customized Commands