Avanti Product Banner

avanti's TaskMaster ®

User Submitted Sample Task
Contributed by: Paul Ponting - United Biscuits (UK)
(Posted: 16 May 2001)




Background
We needed to replace NRS to replicate a single 9Gb volume on a source server to multiple destination servers. The source server houses all NAL delivered applications on a volume called ADMIN, each destination server has a volume named ADMIN and each ADMIN volume must be identical to allow roaming users to use any application they require when at any of our sites. Due to the importance of the synchronisation of the applications, all steps of the task require logging with enough history to backtrack and determine if/when a problem occured.

The Task Files
CEDAR.TSK
REPLICAT.TSK
IGNORE.DAT

The main task is called REPLICAT.TSK, this is called by a seperate task (1 per destination Server). The calling task (CEDAR.TSK in this example) passes only enough information to REPLICAT.TSK to allow it to perform the SYNC and create the necessary log files. This allows only 1 main task to require administering/updating.

Output of the logfiles can be located anywhere on the source Server and is defined by variables within REPLICAT.TSK. The history of the logfiles are defined within the calling task (CEDAR.TSK) and are kept based on 'how many log files are kept' (e.g., if %2 in the calling task is 14, then the last 14 log files are kept, NOT the last 14 days). This value can be set to whatever value required.

The Calling Task (CEDAR.TSK)
%0 = The actual name of the Server
%1 = The short name of the Server. Used to create the output directory name for this Server. This value can be anything and is used in our case to avoid trying to create long directory names based on the server name in the event LONG namespace is not loaded on the output volume.
%2 = How many log files to keep.
%3 = Name of the volume to replicate to on the destination server.

The Main Task (REPLICAT.TSK)
The task should be fairly straight forward, some documentation is included within. One point, I have added some logic within the code that only allows the SYNC to commence if a file named NALVOL.TXT exists in the root of the destination volume, this was placed there because of some problems we had in the early development of the task whereas we tried to SYNC the source ADMIN volume to a remote SYS volume. :(

The Output Files
These are created in the destination directory as specified in %8 in the REPLICAT.TSK file. This directory must exist but the subdirectories are created if necessary by the task. These directories are created by the Short Server name defined in the calling task. Also, under the %8 directory, a status directory is created to give a quick glance view of the current status of the sync process to all Servers. A text file should exist for each scheduled Server (created automatically). The extension of the text file indicates the status of that SYNC:

    CEDAR.OK  = indicates the last SYNC to CEDAR-UK was sucessful.
    CEDAR.RUN = indicates the SYNC to CEDAR-UK is still running.
    CEDAR.WAR = indicates there were some warnings last time the SYNC ran.
    CEDAR.ERR = indicates there were some errors last time the SYNC ran.

These text files also contain a little more information within them, so it is a good idea to associate the extensions to Notepad. We also change the icon for each type (green tick for *.OK, Red cross for *.ERR, etc. ...)

The individual log files for each Server are within the directory defined as: %8\<Short Server Name> where %8 was already defined as VOL1:REPORTS\REPLICAT\. Therefore, CEDAR-UK's log files will be put in VOL1:REPORTS\REPLICAT\CEDAR\.

These file have the extension *.LGG and is associated to Notepad.

Additional Information
UPCHECK.TSK
We also have had times where TaskMstr.NLM on the source Server has been unloaded and caused ALL tasks to not run. I have created another task that runs every hour and creates a text file in the status directory, the text file name is the current time and date. This allows the operations department to raise a warning if the time does not update which would indicate a possible problem with the source Server.