Markers
Top  Previous  Next


·Status markers are basically script progress indicators; an "OK" marker is written in the script next to each successful command.  
·The markers provides visual feedback - when you interrupt a script by clicking the escape key, or if the script stops due to errors, you can see how far the script got by looking at the markers.  
·Markers are also used by SetupBatcher to resume scripts - when you restart a script, SetupBatcher examines the markers and continues where the script last stopped.  
·Markers are used in all sections expect [Settings].  

How to remove / modify markers

·Click "Remove markers" in the main menu.  
·Use the setting BatchSettings.MarkersAutoRemove to automatically remove all old markers when a script is started, this means that the script always starts from the beginning, regardless of previous errors.  
·You can also edit markers manually in the script. Example - remove an "OK" marker next to a command to rerun the command. Notice that you might have to adjust the line counter part of the machine marker too, SetupBatcher will stop if it does not match number of markers in the [Batch] section.  

How markers are written in the sections

[Machines]

Linux and Novell notice: the [Machines] section is not used in Linux or Novell server scripts.

Marker format: x-y  
 
x = error code or "OK" if last command ok  
y = line counter = script line number relative to the start of the section (first=1) or "AllDone" if all done.  
 
·If an error occurs, the error code and the line number of the line in the section where the script stopped is written in column 4 next to the machine name in the [Machines] section.  
·When a machine is finished (all commands done), SetupBatcher, writes "OK-AllDone" in column 4 next to the machine name in the [Machines] section and erases all command section and [Data] section markers.  

Command sections - [Init], [Batch], [Undo], [OnError]

·SetupBatcher writes "OK" in column 2 next to all successful commands. (Read below about the Data.Loop..EndLoop statement.)  

[Data]

·For each row in the [Data] section, all commands in a Data.Loop..EndLoop statement is executed sequentially. An "OK" marker is written next to finished commands.  
·When all commands in the loop is finished for a [Data] row, the markers next to the commands are deleted and an "OK" marker is written in the [Data] section in the BatchSettings.MarkerCol of the row.  
·When the entire [Data] section is finished, the "OK" markers are deleted from the [Data] section and an "OK" marker is written next to the Data.Loop command.  
·If an error occurs in a command in a Data.Loop..EndLoop statement, no marker is written to the [Data] section and the Data.Loop command is marked with the error code and the [Data] section line number (first=0) of the line where the script stopped.  

How SetupBatcher uses the markers when a script is (re)started

SetupBatcher first of all looks for a [Machines] section in the script.
 
Case a) No [Machines] section found  
 
1.Check the [Batch] or [Undo] section for status markers in column 2, lines marked with "OK" are ignored.  
2.The batch job starts at the first row without "OK" marker.  
 
Case b) [Machines] section found  

1.Check the [Machines] section status markers in column 4. Machines marked with "OK-AllDone" are ignored (this is useful to know when you want to resume or rerun a batch job).  
2.Machines pre-scan: try to contact all listed machines. Unreachable machines are marked with an error code and ignored by SetupBatcher, it is possible to rerun the batch job on unreachable machines later when they are back up on the net. If there are unreachable machines, a prompt with number of bad machines etc. is displayed. It is possible to disable pre-scan with the setting BatchSettings.CheckMachines in the [Settings] section, if you do, you must manually reset the error code before restarting the script; either by editing the batch file or by using the "remove markers" function.  
3.Look for an unfinished machine. If found - check markers and resume. If no unfinished machine found - start from the beginning.