7 Replies Latest reply on Apr 30, 2015 2:27 PM by Bill Robinson

    NSH Script Job in Batch Job

    Patrick O'Callaghan

      I have a Batch Job that executes a series of jobs, and the last job is an NSH Script.  The NSH Script checks on the results of the previous jobs and will re execute the Batch job if certain conditions are met.  The Issue I am trying to resolve is, the only way I have been able to figure out how to do this is to use the option "Use Servers from Individual Jobs" and set all the jobs in the Batch job to execute against a server group and set the NSH script job to Target an App Server or File Server.  This is very inconvenient however as this job is going to be used very often on different targets every time and would be easier to be able to "execute against" or just add the target servers to the batch job.


      The reason for this is that the Script job contains BLCLI commands which I know can be run with no targets.  However, the only way I can see to keep track of how many times the job has run and kill the job after a certain amount of runs is to write to a file on a server and read from that file.  This functionality is a must as without a cycle count the job can very easily run on an infinite loop or at least run outside of our deploy window.


      I could read/write to the target servers however this would be unreliable and would create issues as this job will restart servers and continue while the servers are down.


      Is there any way to have an NSH Script job that has a server group as a target but can read/write to only 1 app server or file server?  Or is there any way to use BLCLI commands to accurately record the number of times this job has executed?