//////////////////////////////////////////////////////////////////////////////// // // Task: SYNC-GW.TSK // (Unload/reload GroupWise NLMs for SYNC replication/synchronization) // Author: Avanti Technology, Inc. // http://www.avanti-tech.com // Version: 1.0 - Initial Release // // Description: // ============ // Perform a quick (Local / Remote) backup of just the GroupWise system // prior to a full (Local / Remote) SYNC replication / synchronization so // as to avoid taking down GroupWise for any longer than necessary. // // The GroupWise MTA / POA NLMs are unloaded, a SYNC of just the GroupWise // directory tree is performed, GroupWise is restarted and then the full // SYNC is performed, excluding the GroupWise live directory tree. // // The GroupWise backup can be performed directly to the Remote Server or // to a Local Server destination which is then included in the SYNC to the // Remote Server destination. (In the case of slow WAN links to the Remote // Server destination, it can be advantageous to perform the GroupWise SYNC // to a directory on the Local Server Volume, assuming sufficient space is // available, which is then included in the full SYNC to the Remote Server.) // // Objective: // ========== // Insure a full SYNC to a Remote Server while minimizing GroupWise down time. // Note: Based upon information published by Novell in TID 10068369 // // Usage: // ====== // Script can be manually executed using the TaskMaster TMRUN command // at the TMConsole (Shell) Screen: // // Example: TMRUN [vol:path\]SYNC-GW.TSK // // Note: [vol:path\] is not required if the task resides either // in SYS:SYSTEM or the TaskMaster NLM load directory. // // Script can be scheduled for automatic execution using Client interface or // using the TaskMaster TMSCHEDULE command at the TMConsole (Shell) Screen: // // Examples: TMSCHEDULE ADD SYNC-GW.TSK 01 02:00 // (Executes the 1st of each month at 2:00am) // // TMSCHEDULE ADD SYNC-GW.TSK YNNNNNN 02:00 // (Executes every Sunday [SMTWTFS] at 2:00am) // // Note: Scheduled tasks must reside either in SYS:SYSTEM or the // TaskMaster NLM load directory for security reasons. // // Compatibility: // ============== // This task has been tested on the following platforms without demonstrating // any compatibility issues or any other reported/confirmed conflicts: // TaskMaster v4.10 (or later) // NetWare v5.x / v6.x // GroupWise v5.5 // // Warning: // ======== // AS WITH ANY NEW SOFTWARE PROGRAM, BATCH SCRIPT, OR AUTOMATED PROCESSING // PROCEDURE, CAUTION SHOULD BE EXERCISED AND DUE DILIGENCE OBSERVED DURING // INITIAL IMPLEMENTATION. WHERE POSSIBLE, TESTING SHOULD BE PERFORMED ON // NON-PRODUCTION SYSTEMS PRIOR TO FULL IMPLEMENTATION. // //////////////////////////////////////////////////////////////////////////////// // Check for compatible version of TaskMaster NLM IF "%TM_VERSION%.%TM_SUBVERSION%%TM_REVISION%"<"4.10" // Report the status ECHO. ECHO Error: Incompatible TaskMaster release (requires v4.10 or later)! ECHO. ABORT ENDIF // Alias some Defined Variables for easier code documentation / use VARALIAS %VAR10% %GW_SRC% VARALIAS %VAR11% %GW_DST% VARALIAS %VAR12% %FULL_SRC% VARALIAS %VAR13% %FULL_DST% VARALIAS %VAR14% %SYNC_LOG% VARALIAS %VAR15% %EXC_LIST% // [MODIFY] Define the Source GroupWise MTA / POA path (highest directory) DEFINE %GW_SRC% Volume:Path // [MODIFY] Define the Destination GroupWise MTA / POA path (highest directory) // Note: Remove RemoteServer/ if the destination is on the Local Server else // replace RemoteServer with the appropriate destination Remote Server. DEFINE %GW_DST% RemoteServer/Volume:Path // [MODIFY] Define the Source Volume:Path (highest directory) for full SYNC DEFINE %FULL_SRC% Volume:Path // [MODIFY] Define the Destination Volume:Path (highest directory) for full SYNC // Note: Remove RemoteServer/ if the destination is on the Local Server else // replace RemoteServer with the appropriate destination Remote Server. DEFINE %FULL_DST% RemoteServer/Volume:Path // [MODIFY] Define the SYNC log file (for logging SYNC processing results) // Note: Same VOL:\PATH\FILENAME as the .TSK file but with .LOG extension DEFINE %SYNC_LOG% %TASK_PATH%\%TASK_FILE%.LOG // Unload the GroupWise 5.5 NLMs in the order Novell recommends (TID 10068369) // Note: SLEEP (pause processing) for ## seconds between UNLOAD commans to // assist with proper completion of each NLM UNLOAD request. UNLOAD GWMTA.NLM SLEEP 5 UNLOAD GWPOA.NLM SLEEP 5 UNLOAD GWINTER.NLM SLEEP 5 UNLOAD GWCMC.NLM SLEEP 5 UNLOAD GWIA.NLM SLEEP 5 UNLOAD GWENN2.NLM SLEEP 5 UNLOAD GWENN15.NLM SLEEP 5 // Define Dynamic Variable %0 as a 2 digit numeric with an initial value of 0 // for use as a counter to check for proper unloading of all the NLMs DEFINE %0 00 // Use WHILE LOADED / LOOP to check if final NLM is still loaded // and timeout counter is less than 15 seconds (i.e. remain in WHILE/LOOP // if NLM is loaded and less than 15 seconds have elapsed) WHILE LOADED GWENN15.NLM AND "%0"<"15" // SLEEP (pause processing) for a second SLEEP 1 // Increment counter for the last SLEEP cycle DEFINE %0 %0+=01 LOOP // WHILE/LOOP processing complete - Check if because NLM unloaded or time out IF LOADED GWENN15.NLM // Log the fact that NLM did not unload, skip the SYNC and reload GroupWise OPEN WRITE %SYNC_LOG% TRUNCATE WRITE ERROR: GroupWise NLMs could not all be unloaded - SYNC Aborted! WRITE CLOSE // Output a listing of the loaded GroupWise NLMs for reference... LIST MODULES GW*.* >>%SYNC_LOG% ELSE // GroupWise appears to have been unloaded so perform the SYNC processing... // Note: Review the Options topic in the SYNC FAQ for info on options used // (http://www.avanti-tech.com/taskmstr/sync_faq.htm#Options) SYNC %GW_SRC% %GW_DST% /A /D /H /I /L /S /V /# >%SYNC_LOG% // Define the exclusion list file (listing directories not to be processed) // Note: Same VOL:\PATH\FILENAME as the .TSK file but with .EXC extension DEFINE %EXC_LIST% %TASK_PATH%\%TASK_FILE%.EXC // Exclude the GroupWise source specification since it was processed OPEN WRITE %EXC_LIST% TRUNCATE WRITE %GW_SRC% CLOSE ENDIF // Either GroupWise unloaded / SYNC completed or // GroupWise wouldn't unload / Error logged // so restart the GroupWise system SYSTEM CONSOLE GRPWISE.NCF // Give GroupWise a few seconds to get restarted before resuming SYNC operations SLEEP 5 // Two options exist: Either the GroupWise system could be shut down and the // GroupWise source directory tree SYNC processed or GroupWise could not be // shut down so the GroupWise source directory tree was not SYNC processed. // If properly processed, exclude the GroupWise source directory tree from // the fill SYNC processing else do not exclude it. IF "%EXC_LIST%"=="" // Exclusion list is null so SYNC failed and no exclusion list required. // Redirect this SYNC output to the existing log (like in DOS, >> = append). // Note: Review the Options topic in the SYNC FAQ for info on options used // (http://www.avanti-tech.com/taskmstr/sync_faq.htm#Options) SYNC %FULL_SRC% %FULL_DST% /A /D /H /I /L /S /V /# >>%SYNC_LOG% ELSE // Exclusion list exists so SYNC performed and exclusion list is required. // Redirect this SYNC output to the existing log (like in DOS, >> = append). // Note: Review the Options topic in the SYNC FAQ for info on options used // (http://www.avanti-tech.com/taskmstr/sync_faq.htm#Options) // Review the Exclusions topic in the SYNC FAQ for exclusion info // (http://www.avanti-tech.com/taskmstr/sync_faq.htm#Exclusions) SYNC %FULL_SRC% %FULL_DST% /A /D /H /I /L /S /V /# >>%SYNC_LOG% <%EXC_LIST% ENDIF