{"id":428,"date":"2006-12-29T20:49:03","date_gmt":"2006-12-29T20:49:03","guid":{"rendered":"http:\/\/fiveforks.com\/jeb\/2006\/12\/combining_external_scripts_in\/"},"modified":"2006-12-29T20:49:03","modified_gmt":"2006-12-29T20:49:03","slug":"combining_external_scripts_in","status":"publish","type":"post","link":"https:\/\/www.fiveforks.com\/jeb\/2006\/12\/combining_external_scripts_in\/","title":{"rendered":"Combining External Scripts in Retrospect"},"content":{"rendered":"<p><a href=\"http:\/\/www.google.com\/search?hl=en&amp;client=firefox-a&amp;rls=org.mozilla:en-US:official&amp;hs=jFT&amp;sa=X&amp;oi=spell&amp;resnum=0&amp;ct=result&amp;cd=1&amp;q=retrospect++backup&amp;spell=1\">Retrospect<\/a> (backup software) comes with a number of external scripts. One I use to e-mail reports on backup success and failures. I needed to add another that would shut down a Domino server and then restart it after successful backups. The help files say: &#8220;If you need to run multiple scripts you will have to combine them.&#8221; So with that little clue, I spent time figuring out how to modify a DOS batch file. The secret ended up creating a series of &#8220;IF&#8221; statements up front that would identify the calling scripts (alternating weekly backup scripts) that needed to shut down the Domino server. My mods in bold&#8230;.<\/p>\n<p><!--more--><br \/>\n@ECHO OFF<\/p>\n<p>REM<\/p>\n<p>REM Retrospect Email Notifier<\/p>\n<p>REM<\/p>\n<p>REM     A Retrospect external script to email reports for script executions.<\/p>\n<p>REM Recipients and other required information for using this script are set<\/p>\n<p>REM below in the &#8220;Email Group Properties&#8221;. If you are using Retrospect&#8217;s Backup<\/p>\n<p>REM Server you need to schedule your email reports as detailed in the external<\/p>\n<p>REM scripts read me.<\/p>\n<p>REM<\/p>\n<p>REM Copyright 2000-2002 Dantz Development Corporation<\/p>\n<p>REM<\/p>\n<p><strong>REM &#8212;&#8212;&#8211; Begin Combined Script Switch (by Jeb) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>REM Switch checking for a calling script for Domino shutdown procedure.<\/p>\n<p>set scriptName=%2<\/p>\n<p>set scriptName2={}<\/p>\n<p>if {%scriptName%}=={&#8220;DominoMail1&#8243;} set scriptName2=&#8221;DominoMail&#8221;<\/p>\n<p>if {%scriptName%}=={&#8220;DominoMail2&#8243;} set scriptName2=&#8221;DominoMail&#8221;<\/p>\n<p>if {%scriptName%}=={&#8220;DominoMail3&#8243;} set scriptName2=&#8221;DominoMail&#8221;<\/p>\n<p>if {%scriptName%}=={&#8220;DominoMail4&#8243;} set scriptName2=&#8221;DominoMail&#8221;<\/p>\n<p>if {%scriptName2%}=={&#8220;DominoMail&#8221;} goto :BACKUPDOMINO<\/strong><\/p>\n<p>REM &#8212;&#8212;&#8211; Begin Email Group Properties &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>REM You need to edit the following email group properties.<\/p>\n<p>REM Put your mail server here<\/p>\n<p>set kMailServer=&#8221;<strong>y.fiveforks.com<\/strong>&#8221;<\/p>\n<p>REM Email address of the sender<\/p>\n<p>set kMailSender=&#8221;<strong>d@fiveforks.com<\/strong>&#8221;<\/p>\n<p>REM  To send mail to more than one person, enter the addresses separated by<\/p>\n<p>REM  semicolons, for example:<\/p>\n<p>REM  &#8220;name one;name two&#8221;<\/p>\n<p>REM These recipients will get emails for all events<\/p>\n<p>REM set kMainGroup=&#8221;name one;name two&#8221;<\/p>\n<p>set kMainGroup=&#8221;<strong>cf@gmail.com<\/strong>&#8221;<\/p>\n<p>REM These recipients will get emails only when fatal errors occur<\/p>\n<p>set kFatalErrorGroup=&#8221;&#8221;<\/p>\n<p>REM These recipients will get emails when there is no fatal error<\/p>\n<p>set kSuccessGroup=&#8221;&#8221;<\/p>\n<p>REM These recipients will get emails only when Retrospect needs new media<\/p>\n<p>set kMediaRequestGroup=&#8221;&#8221;<\/p>\n<p>REM The following is the time at which the MediaRequest message is sent.<\/p>\n<p>REM The time unit must be in 5 minute increments and the minimum value is 5 minutes.<\/p>\n<p>set MediaRequestNotificationTime=&#8221;5&#8243;<\/p>\n<p>REM &#8212;&#8212;&#8211; End of Email Group Properites &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM Set up the temporary file names for each type of report<\/p>\n<p>set stdReport=RetroStdReport.txt<\/p>\n<p>set BUSFileName=RetroBUSfile.txt<\/p>\n<p>set tempFile=RetroTemp.txt<\/p>\n<p>set mailLog=mailerr.txt<\/p>\n<p>set dantzHeader=Report generated by Retrospect.<\/p>\n<p>set lineDelim=&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM The following code branches to the procedure labels below, it should not be<\/p>\n<p>REM modified.<\/p>\n<p>If NOT {%1}=={} goto :ENDMSG<\/p>\n<p>Echo     This is a Retrospect external script to email reports for script executions.<\/p>\n<p>Echo Recipients and other required information for using this script are set<\/p>\n<p>Echo by editing this file in the &#8220;Email Group Properties&#8221; section.<\/p>\n<p>Echo     To use this file, copy it to the Retrospect directory.<\/p>\n<p>pause<\/p>\n<p>goto :EXIT<\/p>\n<p>:ENDMSG<\/p>\n<p>If NOT {%kMailServer%}=={&#8220;yourSMTPmailServer.com&#8221;} goto :ENDWARNING<\/p>\n<p>Echo     You must first set the name of your mail server and other<\/p>\n<p>Echo required information for using this script by editing the<\/p>\n<p>Echo &#8220;Email Group Properties&#8221; section located in this file.<\/p>\n<p>pause<\/p>\n<p>goto :EXIT<\/p>\n<p>:ENDWARNING<\/p>\n<p>set _TRIGGERSCRIPT=%0<\/p>\n<p>set _PROC=%1<\/p>\n<p>shift<\/p>\n<p>goto :%_PROC%<\/p>\n<p>REM &#8212; Begin StartApp &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>:StartApp<\/p>\n<p>REM Clear the temporary email files if the power went off<\/p>\n<p>if Exist %stdReport% del %stdReport%<\/p>\n<p>if Exist %BUSFileName% del %BUSFileName%<\/p>\n<p>if Exist %tempFile% del %tempFile%<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End StartApp &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>REM &#8212; Begin StartScript &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>:StartScript<\/p>\n<p>set scriptName=%1<\/p>\n<p>set startDate=%2<\/p>\n<p>if EXIST %BUSFileName% goto :end_StartScript\t\t\t\tREM skip Backup Server scripts<\/p>\n<p>echo %dantzHeader% &gt; %stdReport%<\/p>\n<p>echo %lineDelim% &gt;&gt; %stdReport%<\/p>\n<p>echo Script %scriptName% started on %startDate%. &gt;&gt; %stdReport%<\/p>\n<p>echo %lineDelim% &gt;&gt; %stdReport%<\/p>\n<p>:end_StartScript<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End StartScript &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>REM &#8212; Begin EndScript &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>:EndScript<\/p>\n<p>set scriptName=%1<\/p>\n<p>set numErrors=%2<\/p>\n<p>set fatalErrCode=%3<\/p>\n<p>set fatalErrMsg=%4<\/p>\n<p>REM Successful script execution will dispatch the regular report<\/p>\n<p>REM to the kMainGroup and kSuccessGroup user groups.<\/p>\n<p>if EXIST %BUSFileName% goto :EXIT<\/p>\n<p>if NOT %fatalErrCode%==&#8221;0&#8243; goto :error_EndScript<\/p>\n<p>if %numErrors%==&#8221;0&#8243; set errMsg=successfully<\/p>\n<p>if %numErrors%==&#8221;1&#8243; set errMsg=with 1 error<\/p>\n<p>if {&#8220;%errMsg%&#8221;}=={&#8220;&#8221;} set errMsg=with %numErrors% errors<\/p>\n<p>set mailSubject=&#8221;Retrospect: Execution completed %errMsg%&#8221;<\/p>\n<p>echo %lineDelim% &gt;&gt; %stdReport%<\/p>\n<p>echo Script %scriptName% finished %errMsg%. &gt;&gt; %stdReport%<\/p>\n<p>echo %lineDelim% &gt;&gt; %stdReport%<\/p>\n<p>mailsndr %kMailServer% %mailSubject% %kMailSender% -t %kMainGroup%;%kSuccessGroup% -e %mailLog% %stdReport%<\/p>\n<p>goto :end_EndScript<\/p>\n<p>:error_EndScript<\/p>\n<p>set mailSubject=&#8221;Retrospect script finished with errors&#8221;<\/p>\n<p>echo Script %scriptName% finished with errors. &gt;&gt; %stdReport%<\/p>\n<p>echo Error code %fatalErrCode% %fatalErrMsg%. &gt;&gt; %stdReport%<\/p>\n<p>mailsndr %kMailServer% %mailSubject% %kMailSender% -t %kMainGroup%;%kFatalErrorGroup% -e %mailLog% %stdReport%<\/p>\n<p>:end_EndScript<\/p>\n<p>del %stdReport%<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End EndScript &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>REM &#8212; Begin StartBackupServer &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>:StartBackupServer<\/p>\n<p>set startDate=%1<\/p>\n<p>echo %dantzHeader% &gt; %BUSFileName%<\/p>\n<p>echo %lineDelim% &gt;&gt; %BUSFileName%<\/p>\n<p>echo Backup Server started on %startDate%. &gt;&gt; %BUSFileName%<\/p>\n<p>echo %lineDelim% &gt;&gt; %BUSFileName%<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End StartBackupServer &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>REM &#8212; Begin StopBackupServer &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>:StopBackupServer<\/p>\n<p>set endDate=%1<\/p>\n<p>echo %lineDelim% &gt;&gt; %BUSFileName%<\/p>\n<p>echo Backup Server stopped on %endDate%.&gt;&gt; %BUSFileName%<\/p>\n<p>call %_TRIGGERSCRIPT% SendBUSReport<\/p>\n<p>del %BUSFileName%<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End StopBackupServer &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM &#8212; Begin SendBUSReport &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>:ATSendBUSReport<\/p>\n<p>REM The PATH variable doesn&#8217;t contain the path to the mailsndr.exe when run under<\/p>\n<p>REM the AT command so we pass it in and set the current directory to it here.<\/p>\n<p>if NOT {%1}=={} chdir \/d %1<\/p>\n<p>REM Drop into normal SendBUSReport<\/p>\n<p>:SendBUSReport<\/p>\n<p>if NOT EXIST %BUSFileName% goto :EXIT<\/p>\n<p>set mailSubject=&#8221;Retrospect: Backup Server Report&#8221;<\/p>\n<p>mailsndr %kMailServer% %mailSubject% %kMailSender% -t %kMainGroup% -e %mailLog% %BUSFileName%<\/p>\n<p>REM Reset the file<\/p>\n<p>echo %dantzHeader% &gt; %BUSFileName%<\/p>\n<p>echo %lineDelim% &gt;&gt; %BUSFileName%<\/p>\n<p>echo Retrospect Backup Report &gt;&gt; %BUSFileName%<\/p>\n<p>echo %lineDelim% &gt;&gt; %BUSFileName%<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End SendBUSReport &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM &#8212; Begin EndSource &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>:EndSource<\/p>\n<p>set scriptName=%1<\/p>\n<p>shift<\/p>\n<p>set sourceName=%1<\/p>\n<p>shift<\/p>\n<p>set sourcePath=%1<\/p>\n<p>shift<\/p>\n<p>set clientName=%1<\/p>\n<p>shift<\/p>\n<p>set kbBackedUp=%1<\/p>\n<p>shift<\/p>\n<p>set numFiles=%1<\/p>\n<p>shift<\/p>\n<p>set duration=%1<\/p>\n<p>shift<\/p>\n<p>set sourceStart=%1<\/p>\n<p>shift<\/p>\n<p>set sourceEnd=%1<\/p>\n<p>shift<\/p>\n<p>set scriptStart=%1<\/p>\n<p>shift<\/p>\n<p>set backupSet=%1<\/p>\n<p>shift<\/p>\n<p>set backupAction=%1<\/p>\n<p>shift<\/p>\n<p>set parentVol=%1<\/p>\n<p>shift<\/p>\n<p>set numErrs=%1<\/p>\n<p>shift<\/p>\n<p>set fatalErrCode=%1<\/p>\n<p>shift<\/p>\n<p>set fatalErrMsg=%1<\/p>\n<p>REM Log that we sent a media request in the current report<\/p>\n<p>set logFile=%stdReport%<\/p>\n<p>if EXIST %BUSFileName% set logFile=%BUSFileName%<\/p>\n<p>if NOT %fatalErrCode%==&#8221;0&#8243; goto :EndSrcElse<\/p>\n<p>if NOT %numErrs%==&#8221;0&#8243; set errMsg= with %numErrs% errors<\/p>\n<p>if %numErrs%==&#8221;1&#8243; set errMsg= with 1 error<\/p>\n<p>echo Script %scriptName% finished a %backupAction% backup to %backupSet% on %sourceEnd%&gt;&gt; %logFile%<\/p>\n<p>echo %numFiles% files (%kbBackedUp% KB) on %sourceName% were backed up in %duration% seconds. &gt;&gt; %logFile%<\/p>\n<p>echo . &gt;&gt; %logFile%<\/p>\n<p>goto :EndSrcIf<\/p>\n<p>:EndSrcElse<\/p>\n<p>echo Script %ScriptName% failed to backup volume %sourceName% &gt;&gt; %logFile%<\/p>\n<p>echo with error %fatalErrCode% &#8211; %fatalErrMsg%. &gt;&gt; %logFile%<\/p>\n<p>:EndSrcIf<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End EndSource &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>REM &#8212; begin MediaRequest &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>:MediaRequest<\/p>\n<p>set mediaLabel=%1<\/p>\n<p>set mediaName=%2<\/p>\n<p>set mediaIsKnown=%3<\/p>\n<p>set timeWaited=%4<\/p>\n<p>if NOT %timeWaited%==%MediaRequestNotificationTime% goto :end_MediaRequest<\/p>\n<p>REM Log that we sent a media request in the current report<\/p>\n<p>set logFile=%stdReport%<\/p>\n<p>if EXIST %BUSFileName% set logFile=%BUSFileName%<\/p>\n<p>echo %dantzHeader% &gt; %tempFile%<\/p>\n<p>echo %lineDelim% &gt;&gt; %tempFile%<\/p>\n<p>echo Retrospect needs media %mediaName% (%mediaLabel%). &gt;&gt; %tempFile%<\/p>\n<p>if {%mediaIsKnown%}=={&#8220;true&#8221;} goto :Known_MediaRequest<\/p>\n<p>echo This is either a new or unknown media. &gt;&gt; %tempFile%<\/p>\n<p>goto :end_knownMediaRequest<\/p>\n<p>:Known_MediaRequest<\/p>\n<p>echo Retrospect has backed up to this media before. &gt;&gt; %tempFile%<\/p>\n<p>:end_knownMediaRequest<\/p>\n<p>echo Retrospect has waited %timeWaited% minutes. &gt;&gt; %tempFile%<\/p>\n<p>echo %lineDelim% &gt;&gt; %tempFile%<\/p>\n<p>REM send it to the main and kMediaRequestGroup<\/p>\n<p>mailsndr %kMailServer% &#8220;Retrospect: MediaRequest&#8221; %kMailSender% -t %kMediaRequestGroup%;%kMainGroup% -e %mailLog% %tempFile%<\/p>\n<p>REM log message<\/p>\n<p>cat %tempFile% &gt;&gt; %logFile%<\/p>\n<p>del %tempFile%<\/p>\n<p>:end_MediaRequest<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End MediaRequest &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>REM &#8212; Begin TimedOutMediaRequest &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>:TimedOutMediaRequest<\/p>\n<p>set mediaLabel=%1<\/p>\n<p>set mediaName=%2<\/p>\n<p>set mediaIsKnown=%3<\/p>\n<p>set waited=%4<\/p>\n<p>REM Log that we sent a media request in the current report<\/p>\n<p>set logFile=%stdReport%<\/p>\n<p>if EXIST %BUSFileName% set logFile=%BUSFileName%<\/p>\n<p>set mailSubject=&#8221;Retrospect media request timed out&#8221;<\/p>\n<p>echo %dantzHeader% &gt; %tempFile%<\/p>\n<p>echo %lineDelim% &gt;&gt; %tempFile%<\/p>\n<p>echo Media request for media %mediaName% (%mediaLabel%) timed out before script could finish. &gt;&gt; %tempFile%<\/p>\n<p>mailsndr %kMailServer% %mailSubject% %kMailSender% -t %kMediaRequestGroup%;%kMainGroup% -e %mailLog% %tempFile%<\/p>\n<p>REM log message<\/p>\n<p>cat %tempFile% &gt;&gt; %logFile%<\/p>\n<p>del %tempFile%<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End TimeOutMediaRequest &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM &#8212; Begin FatalBackupError &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>:FatalBackupError<\/p>\n<p>set scriptName=%1<\/p>\n<p>set failureCause=%2<\/p>\n<p>set errCode=%3<\/p>\n<p>set errMsg=%4<\/p>\n<p>set errZone=%5<\/p>\n<p>REM Log that we sent a media request in the current report<\/p>\n<p>set logFile=%stdReport%<\/p>\n<p>if EXIST %BUSFileName% set logFile=%BUSFileName%<\/p>\n<p>set mailSubject=&#8221;Retrospect Fatal Backup Error&#8221;<\/p>\n<p>echo Script %scriptName% failed with error code %errCode% &#8211; %errMsg% in %errZone%. &gt; %tempFile%<\/p>\n<p>mailsndr %kMailServer% %mailSubject% %kMailSender% -t %kMainGroup%;%kFatalErrorGroup% -e %mailLog% %tempFile%<\/p>\n<p>REM log message<\/p>\n<p>cat %tempFile% &gt;&gt; %logFile%<\/p>\n<p>del %tempFile%<\/p>\n<p>goto :EXIT<\/p>\n<p>REM &#8212; End FatalBackupError &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM unused procedure tags<\/p>\n<p>:EndApp<\/p>\n<p>:StartSource<\/p>\n<p>:ScriptCheckFailed<\/p>\n<p>:NextExec<\/p>\n<p>:StopSched<\/p>\n<p>:PasswordEntry<\/p>\n<p>:EXIT<\/p>\n<p>@echo off<\/p>\n<p><strong>:BACKUPDOMINO<\/strong><\/p>\n<p>REM<\/p>\n<p>REM Retrospect Event Handler &#8211; Lotus Domino Server<\/p>\n<p>REM<\/p>\n<p>REM          This batch file will stop a Lotus Domino server running as a<\/p>\n<p>REM service when a Retrospect script named &#8220;Backup Domino&#8221; is run. It will<\/p>\n<p>REM restart the server after the script is finished.<\/p>\n<p>REM<\/p>\n<p>REM\tThe service defined in this script must match the service name in<\/p>\n<p>REM the services control panel.<\/p>\n<p>REM<\/p>\n<p>REM Copyright 2000 Dantz Development Corporation<\/p>\n<p>REM<\/p>\n<p>REM The following code branches to the procedure labels below, it should not be<\/p>\n<p>REM modified.<\/p>\n<p>If NOT {%1}=={} goto :ENDMSG<\/p>\n<p>echo     This batch file will stop a Lotus Domino server running as a<\/p>\n<p>echo service when a Retrospect script named &#8220;Backup Domino&#8221; is run.<\/p>\n<p>echo It will restart the Domino Server after the script is finished.<\/p>\n<p>echo      To use this file, copy it to the Retrospect directory.<\/p>\n<p>REM\tpause<\/p>\n<p>goto :RETURN_OK<\/p>\n<p>:ENDMSG<\/p>\n<p>if {%1}=={} goto :RETURN_OK<\/p>\n<p>set _PROC=%1<\/p>\n<p>shift<\/p>\n<p>goto :%_PROC%<\/p>\n<p>REM &#8212; Begin StartSource&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>:StartSource<\/p>\n<p>set scriptName=%1<\/p>\n<p>REM scriptName can be edited to match script names in Retrospect.<\/p>\n<p>if {%<strong>scriptName2%<\/strong>}=={&#8220;<strong>DominoMail<\/strong>&#8220;} call :STOP_DOMINO_SERVER<\/p>\n<p>goto :RETURN_OK REM &#8212; End StartSource<\/p>\n<p>REM &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM &#8212; Begin EndSource &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>:EndSource<\/p>\n<p>set scriptName=%1<\/p>\n<p>if {%<strong>scriptName2<\/strong>%}=={&#8220;<strong>DominoMail<\/strong>&#8220;} call :START_DOMINO_SERVER<\/p>\n<p>goto :RETURN_OK REM &#8212; End EndSource<\/p>\n<p>REM &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>REM Stop the Domino Server by stopping the service.<\/p>\n<p>REM Domino Server must be running as a service.<\/p>\n<p>:STOP_DOMINO_SERVER<\/p>\n<p>REM Stop the Domino Server.<\/p>\n<p>echo Stopping Domino Server<\/p>\n<p>REM Service name must exactly match the service you are stopping.<\/p>\n<p>net stop &#8220;Lotus Domino Server&#8221;<\/p>\n<p>goto :RETURN_OK<\/p>\n<p>REM Start the Domino server<\/p>\n<p>:START_DOMINO_SERVER<\/p>\n<p>echo Starting Domino Server<\/p>\n<p>REM Service name must exactly match the service you are starting.<\/p>\n<p>net start &#8220;Lotus Domino Server&#8221;<\/p>\n<p>goto :RETURN_OK<\/p>\n<p>REM stub procedure tags<\/p>\n<p>:StartApp<\/p>\n<p>:EndApp<\/p>\n<p>:StartBackupServer<\/p>\n<p>:StopBackupServer<\/p>\n<p>:StartScript<\/p>\n<p>:StopScript<\/p>\n<p>:MediaRequest<\/p>\n<p>:TimedOutMediaRequest<\/p>\n<p>:ScriptCheckFailed<\/p>\n<p>:NextExec<\/p>\n<p>:StopSched<\/p>\n<p>:PasswordEntry<\/p>\n<p>:RETURN_OK<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Retrospect (backup software) comes with a number of external scripts. One I use to e-mail reports on backup success and failures. I needed to add another that would shut down a Domino server and then restart it after successful backups. &hellip; <a href=\"https:\/\/www.fiveforks.com\/jeb\/2006\/12\/combining_external_scripts_in\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-428","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/posts\/428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/comments?post=428"}],"version-history":[{"count":0,"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/posts\/428\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/media?parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/categories?post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fiveforks.com\/jeb\/wp-json\/wp\/v2\/tags?post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}