JobRun - getJobRunIsRunningByRunKey

JobRun - getJobRunIsRunningByRunKey

Description :

This command returns a boolean indicating whether the job run is running:

  • True: job is running
  • False: job is not running

Return type : Boolean

Command Input :

Variable Name

Variable Type

Description

jobRunKey

com.bladelogic.om.infra.model.base.keys.SJobRunKey

Handle to a particular job run.

Example

The following example determines whether a job is running:

Script





JOB_GROUP=/audits 

JOB_NAME=audit_nocdb 



JOB_KEY=`blcli AuditJob getDBKeyByGroupAndName $JOB_GROUP $JOB_NAME` 

RUN_KEYS=`blcli JobRun findAllRunKeysByJobKey $JOB_KEY` 


for RUN_KEY in ${RUN_KEYS} 

do 

IS_RUNNING=`blcli JobRun getJobRunIsRunningByRunKey $RUN_KEY` 

START_TIME=`blcli JobRun getStartTimeByRunKey $RUN_KEY` 


if [ "$IS_RUNNING" = "false" ] 

then 

NORUNNING=true 

else 

NORUNNING=false 

fi 

done 

if [ "$NORUNNING" = "true" ] 

then 

echo There are no active job runs. for $JOB_GROUP/$JOB_NAME 

else 

echo Run started at $START_TIME is still running 

fi 




Was this page helpful? Yes No Submitting... Thank you

Comments