Conditional Scope

Reference:        If/End_If
                        Wait_For_Completion

A command’s scope specifies whether it applies to each server or to the entire script.  It includes the actions that are being tested by the command, as well as those actions that fall within the Else and End_If blocks.

A conditional whose scope is the entire script is complete only when every preceding action has been completed for all servers in the script.  When applied to the If command, all critical actions that directly precede the command must be completed successfully for a CompletedOK condition to be satisfied.  When applied to a Wait_For_Completion command, the actions must merely complete, regardless of their success.

A conditional whose scope is Each_Server performs the same checks, but does so for each server named in the script.  A failed action for one server does not stop the processing for other servers.  In addition, any Log, Run or Alert action containing the Remote Node wildcard (%RN) is processed for each server that executes the conditional command.  This allows you to parameterize these actions based on the server.  For example, you could send a different mail message or run a different program depending on which server actually finished.

Each_Server has several additional effects:

      Every action within its scope must include a server name and/or the %RN wildcard.  This means that actions being tested or controlled by the condition MUST fit this definition.  A local copy that precedes such an If command will not even be scheduled.

      Only those servers involved in the conditional test are processed through the IF or ELSE blocks.  CompletedOK applies to all actions preceding the condition that involve remote servers.  File Present applies only to the server listed in the file name.  To include a check that applies to all servers, enter:

      {%RN}c:\<path>\<file mask>

where %RN is replaced by each server with actions that precede the test.  You may refer to a local file only when using %RN in the name itself.

      C:\<path that includes %RN>\<or file that include %RN>

      Only additional Each_Server conditions may be used.  If you wish to once again apply the conditions globally, you must exit all Each_Server blocks.

      While commands are not allowed within an Each_Server condition.

      Assign commands are valid when assigning a variable with a name prefixed by SV, indicating that the variable will take on a value for each server in the block.