avanti's TaskMaster
®
|
| Task (.TSK) Tips | |
| DIR Custom Reports: | Use the options available in DIR to create custom File System reports |
| IF EXIST for Remote DIR / VOL: | Test to confirm the existence of a Directory or Volume on a Remote Server |
| Subroutines in a .TSK: | Implementing subroutines (GOSUB/RETURN) within a task script |
| Overlapping Tasks: | Avoid concurrent execution of a task; Suspend a task until another task completes. |
|
|
|
| Additional Information/Support Links | |
| Enhanced Processor: | TaskMaster / TMLite Quick Reference: Enhanced Batch Processor |
| Extended Commands: | TaskMaster / TMLite Quick Reference: Extended Console Commands |
| Sample Tasks: | Examples of TaskMaster task script logic. |
|
|
|
| General FAQ: | Frequently Asked Questions (FAQs) about avanti's products. |
| SYNC FAQ: | Frequently Asked Questions (FAQs) about TaskMaster's SYNC command. |
| TaskMaster FAQ | Frequently Asked Questions (FAQs) about TaskMaster. |
|
DIR CUSTOM REPORTS:
Using the options supported by the DIR extended Local Console Command,
it is possible to collect and output highly selective information about
the File System contents.
The following examples will demonstrate how the options supported by DIR
can be combined to produce a slective report:
Note: DIR supports output redirection (>vol:path\filename.ext) to
send the output displayed on the Server Console screen to a file.
List all entries in the SYS:SYSTEM directory:
List only those entries matching a specific pattern (*.NLM):
Change the pattern to a generic wild card (*.*), change the starting
point to the root of the SYS Volume (SYS:), and recurse (/S - search)
all directories in the directory tree beneath the starting point:
Change the output to only provide bare information
(/B - vol:path\filename.ext only, no entry information)
for entries in the SYS Volume:
Limit the bare output to entries in the SYS Volume
with the Hidden attribute set (/A=H):
Limit the bare output to entries in the SYS Volume
without the Read Only attribute set (/A=-RO):
Limit the bare output to entries in the SYS Volume
which are Files (/-D = exclude Directories):
Limit the bare output to entries in the SYS Volume
which are Directories (/-F = exclude Files):
Limit the bare output to entries in the SYS Volume
Owned by Admin.ctx (/O=Admin.ctx):
Limit the bare output to entries in the SYS Volume
without a valid Owner ID assigned (/-O):
Limit the bare output to entries in the SYS Volume
with Admin.ctx assigned as a Trustee (/R=Admin.ctx):
Limit the bare output to entries in the SYS Volume
with an invalid Trustee assigned (/-R):
Limit the bare output to entries in the SYS Volume
with a Size of 1 KB (/L=1024):
Limit the bare output to entries in the SYS Volume
with a Size of 1 MB or less (/L=-1048576):
Limit the bare output to entries in the SYS Volume
with a Size of 2 MB or more (/L=+2097152):
Limit the bare output to entries in the SYS Volume
with a Size between 1 MB and 2 MB (/L=1048576-2097152):
Limit the bare output to entries in the SYS Volume
that were Created on 26 July 2004 (/T=C2004/07/26):
Limit the bare output to entries in the SYS Volume
that were Created on or before 26 July 2004 (/T=C-2004/07/26):
Limit the bare output to entries in the SYS Volume
that were Created on or after 26 July 2004 (/T=C+2004/07/26):
Limit the bare output to entries in the SYS Volume
that were Created between 21 - 26 July 2004 (/T=C2004/07/21-2004/07/26):
Combined Custom Report Examples:
Produce a normal listing of
only Files
with a .MPG extension
in or below the SYS:HOME base directory
that are 2 MB or larger:
Produce a normal listing of
all new File System entries
in the SYS Volume
Created on 27 July 2004:
Produce a bare output listing of
all *.NLM Files
in the SYS:SYSTEM directory
without a valid Owner assigment:
Produce a bare output listing of
all entries
in the SYS Volume
Owned by Admin.ctx
Created between 01 - 31 July 2004
of a Size of 1 MB or larger:
|
|
|
|
IF EXIST for Remote DIR / VOL:
While the IF EXIST conditional test does not support Remote Servers
directly in the current release, the following technique can be used
to test for the existence of a Directory or Volume on a Remote Server:
In the TMSCMD command line, [RemoteServer] should be replaced with
the name of the Remote Server on which the DIR / VOL resides (e.g.,
AVANTI_510 instead of [RemoteServer]).
The Directory to be checked ([vol:path) needs to be specified in
NetWare format (e.g., SYS:SYSTEM) and relative to the Remote Server
(i.e., the Remote Server name is not required in this specification).
To check for the existence of a Volume, check for the Root Directory
of the Volume (i.e., SYS:\).
In the example above, the results are displayed to the screen using
the ECHO command.
Substitute the appropriate commands for success or failure in place
of the ECHO commands.
In the following example, the logic will check for the existence of
the SYS:SYSTEM directory on the Server FSBACKUP and EXIT (i.e.,
terminate the task) if not found:
In the following example, the logic will check for the existence of
the DATA:APPS directory on the Server FSBACKUP.
If the directory does not exist, the TMSCMD command is used to send
the MKDIR DATA:APPS command to the Remote Server FSBACKUP to create
the directory.
If the directory exists, the TMSCMD command is used to send the
DELTREE DATA:APPS\*.* command to the Remote Server FSBACKUP to
clear (empty) the directory.
|
|
|
|
SUBROUTINES IN A .TSK:
There are occassions within task logic where it would be convenient
to be able to transfer processing to (GOTO) a different part of the
task script, yet be able to return back after executing the special
commands.
Some versions of BASIC and scripting languages provide such
capabilities via CALL or GOSUB commands.
TaskMaster's scripting language does not currently support GOSUB and
implements the CALL command similar to DOS batch processing (i.e.,
suspend processing of the current task until a separate task script,
specified by the CALL command, completes processing).
However, due to TaskMaster's dynamic variable support, it is possible
to implement the GOSUB functionality in the current release.
The following example searches a specific set of subdirectories for
a specific set of filenames / extensions:
|
|
|
|
OVERLAPPING TASKS:
TaskMaster supports concurrent and multiple task execution by providing
each task with its own Current Working Directory (CWD) and stack.
Depending upon the task schedule and the operations performed within the
task, it is possible for a scheduled task to begin execution prior to the
completion of a previous iteration of the same task.
There are also situations where it can be important to assure the
completion of a separate task prior to execution of the current task.
Avoid Concurrent Execution of a Task:
Note: The name of a different task (TASKNAME.EXT) can be
be substituted for the %TASK% System Environment Variable to confirm
completion of a different task.
Note: The name of the appropriate output redirection file
should be substituted for the bracketed ([]) SYS:SYNC.LOG file name
(excluding the brackets).
Note: The name of the appropriate task should be substituted
for the bracketed ([]) PREVTASK.TSK task name (exclude the brackets).
The name of the current task can be automatically assumed via the
%TASK% System Environment Variable to suspend concurrent execution of
the same task.
Note: The name of the appropriate output redirection file
should be substituted for the bracketed ([]) SYS:SYNC.LOG file name
(excluding the brackets).
|
|
|