//============================================================================= // // Task: AVUNLOAD.TSK // (Unload Anti-Virus software prior to Backup) // Author: Avanti Technology, Inc. // http://www.avanti-tech.com // Version: 1.0 - First Release // (20 November 2002) // // Description: // ============ // Performs the actions necessary to unload an Anti-Virus NLM prior to Backup. // // Objective: // ========== // Automate the unloading of the Anti-Virus NLM prior to Backup launching. // // Usage: // ====== // Script can be manually executed using the TaskMaster TMRUN command // at the TMConsole (Shell) Screen: // // Example: TMRUN [vol:path\]AVUNLOAD.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 AVUNLOAD.TSK 01 02:00 // (Executes the 1st of each month at 2:00am) // // TMSCHEDULE ADD AVUNLOAD.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 v3.15c (or later), TaskMaster Lite v3.15c (or later) // NetWare v3.12 / v3.2 / v4.1x / v5.x / v6.0 // // 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. // // Comments: // ========= // This task script is provided free of charge and without any warranty or // guarantee of fitness of purpose or performance. // // For additional TaskMaster script examples, visit the Sample Tasks page // on the Avanti Technology, Inc. WEB Site: http://www.avanti-tech.com // //============================================================================= // Check that the version of TaskMaster loaded is compatible (3.15c or later) IF "%TM_VERSION%.%TM_SUBVERSION%%TM_REVISION%"<"3.15c" // Echo the problem message to the screen ECHO. ECHO Error: Incompatible TaskMaster release (requires v3.15c or later)! ECHO. ABORT ENDIF // Check that the same task is not running more than one instance concurrently IF ACTIVE_TASK %TASK% ECHO. ECHO %MONTH%/%DAY%/%YEAR% @ %HOUR%:%MINUTE%:%SECOND% %AM_PM% ECHO %TASK% ERROR: Task is already active (concurrent execution)... ECHO Aborting further processing! ECHO. ABORT ENDIF // Check if the Anti-Virus NLM is loaded (no need to process, if not) // Note: Change AVMODULE.NLM to the appropriate Anti-Virus NLM name. IF NOT LOADED AVMODULE.NLM ECHO. ECHO %MONTH%/%DAY%/%YEAR% @ %HOUR%:%MINUTE%:%SECOND% %AM_PM% ECHO %TASK% ERROR: Anti-Virus NLM not loaded... ECHO Aborting further processing! ECHO. ABORT ENDIF // To unload the Anti-Virus NLM, we must activate its screen and // submit the appropriate keystroke sequence which shuts it down // First, activate the Anti-Virus NLM screen // Note: Change the screen name (between the double quotes) as appropriate. // To determine the appropriate screen name, press the Alt key when // the screen is active and the name should appear across the top. CHANGE_SCREEN "Anti-Virus NLM Screen" // Give it a second to react SLEEP 1 // Check that the proper screen was activated (the CURRENT_SCREEN name // should be the same as specified above for the CHANGE_SCREEN action). IF NOT CURRENT_SCREEN "Anti-Virus NLM Screen" ECHO. ECHO %MONTH%/%DAY%/%YEAR% @ %HOUR%:%MINUTE%:%SECOND% %AM_PM% ECHO %TASK% ERROR: Unable to activate Anti-Virus NLM screen... ECHO Aborting further processing! ECHO. ABORT ENDIF // Now to submit the key sequence which will verify intent to unload the NLM. // Note: Change the KEYIN keywords/strings as appropriate. KEYIN ESC // Give it a second to react SLEEP 1 // Check for the prompt to unload the NLM? // Note: Change the SCAN_SCREEN string as appropriate (case sensitive). IF NOT SCAN_SCREEN "Unload the NLM?" // Try the KEYIN again, just in case the first time didn't take KEYIN ESC // Give it a second to react SLEEP 1 // Check for the prompt to unload the NLM? // Note: Change the SCAN_SCREEN string as appropriate (case sensitive). IF NOT SCAN_SCREEN "Unload the NLM?" ECHO. ECHO %MONTH%/%DAY%/%YEAR% @ %HOUR%:%MINUTE%:%SECOND% %AM_PM% ECHO %TASK% ERROR: Unable to activate NLM unload prompt... ECHO Aborting further processing! ECHO. ABORT ENDIF ENDIF // First verify that we want to unload the NLM // Note: Change the KEYIN keywords/strings as appropriate. // The verify prompt may only require "YES" ENTER or "Y" ENTER or "Y". KEYIN "YES" ENTER // Give it a second to react SLEEP 1 // First verify that we want to unload the NLM // Note: Change the KEYIN keywords/strings as appropriate. // The password prompt probably requires the password "string" and ENTER. KEYIN "password" ENTER // Give it a change to shutdown SLEEP 5 // Check if the Anti-Virus NLM is still loaded (possible KEYIN/password problem) // Note: Change AVMODULE.NLM to the appropriate Anti-Virus NLM name. IF NOT LOADED AVMODULE.NLM ECHO. ECHO %MONTH%/%DAY%/%YEAR% @ %HOUR%:%MINUTE%:%SECOND% %AM_PM% ECHO %TASK% ERROR: Anti-Virus NLM failed to unload (password?)... ECHO Aborting further processing! ECHO. ABORT ENDIF // Finished... At this point, you could actually add the logic to start // the Backup processing, thus only backing up if the Anti-Virus unloads.