/////////////////////////////////////////////////////////////////// // // This task demonstrates how to write a custom header record into // an output redirection file, prior to launching any TaskMaster // command which supports redirecting its output to a file. // /////////////////////////////////////////////////////////////////// // Open the output redirection file. // Note: The TRUNCATE option overwrites any existing data. // Remove the TRUNCATE option if the output redirection // file will already exist and the contents are desired. // // In this example, SYS:SYNC.LOG is used since SYNC is the // command used in the example. // // The output redirection file name can be named any valid // NetWare file name as long as it is on the local Server. OPEN_WRITE SYS:SYNC.LOG TRUNCATE // Write the custom header information. // Example using TaskMaster environment variables for date/time. WRITE Started at %HOUR%:%MINUTE%%AM_PM% on %MONTH%/%DAY%/%YEAR% // Close output redirection file (exclusive access required). CLOSE // Issue the command (SYNC is used for this example but any // TaskMaster command supporting output redirection will work). // Be sure to use the append mode (>>) or else the previously // written header record (and all other contents) will be lost. // Notice that in this SYNC example, the /L option is specified // so that the SYNC command line is also written to the file. SYNC SOURCE:APPS DEST:APPS /A /D /L /S /V >>SYS:SYNC.LOG // At this point, a footer could also be written. // Just be sure to not to use TRUNCATE with the OPEN_WRITE // (TRUNCATE will overwrite the redirected output from SYNC).