1 2 Previous Next 18 Replies Latest reply on Sep 29, 2014 7:55 AM by richard mcleod

    Exporting Deploy Job logs

    richard mcleod

      Having some major trouble with exporting deploy job logs...

       

      This is what I'm doing, from what I interpret the documentation to mean it looks correct.

       

      blcli_execute JobRun getJobKey

      blcli_storeenv mjJobKeyForRun

      blcli_execute JobRun getDBKey

      blcli_storeenv mjJobDBKeyForRun

      blcli_execute JobRun getJobRunId

      blcli_execute mjJobRunIdForRun

      blcli_execute Job findByDBKey ${mjJobDBKeyForRun}

      blcli_execute Job getDBKey

      blcli_storeenv mjJobDBKey

       

      blcli_execute Utility exportDeployRun "/group/whatever" "jobName" "$mjJobRunIdForRun" "file.csv"

       

      This fails with this message:

      Error09/08/2014 16:51:51Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : jobName group : 2004882 and type : DEPLOY_JOB

       

      If I try to use

       

      blcli_execute Utility exportDeployResults "$mjJobDBKey" "$mjJobKeyForRun" "file.csv"

       

      it fails with this message:

      Error09/08/2014 16:51:51Command execution failed. java.lang.ClassCastException: com.bladelogic.om.infra.model.base.keys.SJobRunModelKeyImpl cannot be cast to com.bladelogic.om.infra.model.base.keys.SJobKey
        • 1. Re: Exporting Deploy Job logs
          Bill Robinson

          i'm not sure why you are running all of those commands.. when you start this what information do you have about the job or job run ?

          • 2. Re: Exporting Deploy Job logs
            richard mcleod

            Well... The top level batch jobDBKey and the top level batch JobRunKey. So i use getMemberJobRunsByBatchJobRun and then loop through those jobs. For each loop I get set the following variables whether I use them or not

             

            JobRun getJobRunId

            JobRun getType

            JobRun getJobKey

            JobRun getDBKey

            JobRun getJobName

            Job getDBKey

            Job getGroupId

            Group getAQualifiedGroupName

            • 3. Re: Exporting Deploy Job logs
              richard mcleod

              Tested each possible Object ID also!

               

              (16:35:41) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "10"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY

              (16:37:26) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "30"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB

              (16:37:39) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "201"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_DRYRUN_JOB

              (16:37:52) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "202"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_STAGING_JOB

              (16:37:56) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "203"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_APPLY_JOB

              (16:37:58) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "204"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_UNDO_JOB

              (16:38:02) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "205"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB_ATTEMPT

              (16:38:04) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "207"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB_RESULT

              (16:38:09) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "208"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_DRYRUN_JOB_RESULT

              (16:38:13) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "209"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_STAGING_JOB_RESULT

              (16:38:15) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "210"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_APPLY_JOB_RESULT

              (16:38:22) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "214"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB_RUN_HEADER

              (16:38:28) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "218"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB_RESULT_TARGET

              (16:38:32) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "380"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB_RUN

              (16:38:44) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "381"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_DRYRUN_JOB_RUN

              (16:38:47) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "382"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_STAGING_JOB_RUN

              (16:38:50) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "383"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_APPLY_JOB_RUN

              (16:38:53) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "384"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_UNDO_JOB_RUN

              (16:38:58) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "385"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_ATTEMPT_JOB_RUN

              (16:38:59) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "441"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_LOG_ITEM

              (16:39:09) hostname:/Users/myuser| blcli_execute Job getDBKeyByTypeGroupAndName "/path/to/job" "job_name_123" "7036"

              Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB_TEMPLATE

              • 4. Re: Exporting Deploy Job logs
                Bill Robinson

                yeah - so you have a few problems here..  a model type is of 10 is not a deploy job.  deploy jobs are 30.  so this one:

                 

                Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : job_name_123 group : 2004882 and type : DEPLOY_JOB

                 

                is the right one.  are you sure it's a deploy job and not a file deploy job ?  screenshot maybe ?  if you have the dbkey of the job from the other commands run a 'Job getType' on it and you'll get the type id.

                 

                i'd make sure it's the right object type here.

                • 5. Re: Exporting Deploy Job logs

                  Hi,

                   

                  I posted a script a while ago. Maybe it's of some use. Retrieving execution logs of BladeLogic Jobs

                   

                  Because the DeployJob is in fact a kind of BatchJob, you also need to retrieve its childs logs.

                   

                  Olivier.

                  • 6. Re: Exporting Deploy Job logs
                    richard mcleod

                    Olivier - sounds awesome, Is there a similar command to BatchJobRun getMemberJobRunsByBatchJobRun for deploy jobs?

                     

                    I don't have access to your post

                     

                    The area of BMC Communities is visible to registered logged in users. If you are logged in when you receive this message then you might not have sufficient access privileges to view requested page. Please contact us if you need any further assistance.


                    Bill Robinson

                    Here is the output from my debugging

                     

                    Info09/09/2014 17:27:39#################################
                    Error09/09/2014 17:27:39Command execution failed. com.bladelogic.om.infra.mfw.util.BlException: Unexpected exception while handling request.com.bladelogic.om.infra.app.api.JobService_findByDBKey(com.bladelogic.om.infra.model.base.keys.DBKey): java.lang.ClassCastException: com.bladelogic.om.infra.model.base.keys.SJobRunModelKeyImpl cannot be cast to com.bladelogic.om.infra.model.base.keys.SJobKey
                    Info09/09/2014 17:27:39jrJobRunId: 5799367
                    Error09/09/2014 17:27:39Command execution failed. java.lang.Throwable: Command Execution Failed: java.lang.Throwable: Command Execution Failed
                    Info09/09/2014 17:27:39jrJobKey: 380
                    Error09/09/2014 17:27:39Cannot store a failed command result
                    Info09/09/2014 17:27:39jrJobKey: DBKey:SJobKeyImpl:946052-6
                    Error09/09/2014 17:27:39Command execution failed. java.lang.Throwable: Command Execution Failed: java.lang.Throwable: Command Execution Failed
                    Error09/09/2014 17:27:39Cannot store a failed command result
                    Info09/09/2014 17:27:39jJobDBKey:
                    Error09/09/2014 17:27:39Command execution failed. java.lang.Throwable: Command Execution Failed: java.lang.Throwable: Command Execution Failed
                    Error09/09/2014 17:27:39Cannot store a failed command result
                    Info09/09/2014 17:27:39jrJobDBKey: DBKey:SJobRunModelKeyImpl:5799367-23299714
                    Info09/09/2014 17:27:39jrJobName: rhel_upgrade_6u4-v2.1
                    Info09/09/2014 17:27:39jJobKey:
                    Info09/09/2014 17:27:39jGroupID: 2004882
                    Info09/09/2014 17:27:39gGroupName: /R&D Applications/General Applications/upgrade
                    Info09/09/2014 17:27:39logname: 20140909-17.26.25_380_2004882_rhel_upgrade_6u4-v2.1
                    Info09/09/2014 17:27:39exportLog: /tmp/20140909-17.26.25_380_2004882_rhel_upgrade_6u4-v2.1.csv
                    Info09/09/2014 17:27:39Deploy job exported!
                    Error09/09/2014 17:27:39Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: No job found with name : rhel_upgrade_6u4-v2.1 group : 2004882 and type : DEPLOY_JOB
                    Error09/09/2014 17:27:39Command execution failed. com.bladelogic.om.infra.cli.factory.CommandNotFoundException: Found command 'Utility.exportDeployResults' but with mismatching arguments. : java.lang.IllegalArgumentException: Bad db key token :


                    Here is the script that generates the debugging

                    blcli_execute Utility setTargetObject mbJobRuns

                    blcli_execute Utility listItemSelect ${k}

                    blcli_execute Utility setTargetObject

                    blcli_execute JobRun getJobRunId

                    blcli_storeenv jrJobRunId

                    blcli_execute JobRun getType

                    blcli_storeenv jrJobType

                    blcli_execute JobRun getJobKey

                    blcli_storeenv jrJobKey

                    blcli_execute JobRun getDBKey

                    blcli_storeenv jrJobDBKey

                    blcli_execute JobRun getJobName

                    blcli_storeenv jrJobName

                    blcli_execute Job findByDBKey ${jrJobDBKey}

                    blcli_execute Job getJobKey

                    blcli_storeenv jJobKey

                    blcli_execute Job getDBKey

                    blcli_storeenv jJobDBKey

                    blcli_execute Job getGroupId $jJobDBKey

                    blcli_storeenv jGroupID

                    blcli_execute Group getAQualifiedGroupName "5005" "$jGroupID"

                    blcli_storeenv gGroupName

                    echo "\n#################################\n"

                    echo "jrJobRunId: $jrJobRunId\n"

                    echo "jrJobKey: $jrJobType\n"

                    echo "jrJobKey: $jrJobKey\n"

                    echo "jJobDBKey: $jJobDBKey\n"

                    echo "jrJobDBKey: $jrJobDBKey\n"

                    echo "jrJobName: $jrJobName\n"

                    echo "jJobKey: $jJobKey\n"

                    echo "jGroupID: $jGroupID\n"

                    echo "gGroupName: $gGroupName\n"

                     

                    also this is a screen shot of job_123

                    • 7. Re: Exporting Deploy Job logs
                      Bill Robinson

                      blcli_exeucte DeployJob getDBKeyByGroupAndName "/some/group" "somejob"

                      blcli_storeenv deployJobKey

                      blcli_execute JobRun getDeployJobMaxRunId ${deployJobKey}

                      blcliI_storeenv jobRunId

                      blcli_execute Utility exportDeployRun "/some/group" "somejob" ${jobRunId} "/some/file.txt"

                      • 8. Re: Exporting Deploy Job logs
                        richard mcleod

                        Thanks Bill - going to give this a go.

                         

                        Something I just came across was that the command getting the group path was using the value from the parent batch job instead of the deploy job, hence the message. Since I was setting this value in two different places, Im trying to separate them into 2 vars

                        • 9. Re: Exporting Deploy Job logs
                          richard mcleod

                          Also I'm slightly concerned that Blade is running commands out of order  OR running the next command before the previous one finishes. Only think this because the output im expecting not in the order that i've echoed it.

                          • 10. Re: Exporting Deploy Job logs
                            richard mcleod

                            This is absolutely insane. Script is running commands before last is finished. I even put  wait's in the script. Is blcli_execute too fast???

                            • 11. Re: Exporting Deploy Job logs
                              Sean Berry

                              Can you paste some output?

                              • 12. Re: Exporting Deploy Job logs
                                Bill Robinson

                                why do you think blade is running things out of order ?

                                • 13. Re: Exporting Deploy Job logs
                                  richard mcleod

                                  Just checked every variable. apparently i had one command using the jobRunKey instead of the jobKey which ended up throwing the rest of the script off. I think I have it working perfect (or as close as I can come). Will post once complete.

                                   

                                  Will allow you to kick off a batch job via nsh script, then echo out all the job logs from the jobs inside... this can be used to check for errors and fail the batch based on the results of the inside jobs.

                                  • 14. Re: Exporting Deploy Job logs
                                    richard mcleod

                                    here. you can feed this nsh script job a /path/to/a/batch/job as $1 and it will kick off the job and report the output

                                     

                                    I have some job types exempt right now as my focus was deploy, file deploy, batch and nsh script. I expect to update overtime though. Hope it helps anyone who needs it

                                     

                                    function jobLogs {
                                    #Deploy Job
                                    if [[ "${jrJobType}" = "380" ]]; then
                                    blcli_execute DeployJobRun findLastRunIdByJobKey "${jrJobKey}"
                                    blcli_storeenv djJobRunId
                                    blcli_execute Utility exportDeployRun "${gGroupName}" "${jrJobName}" "${djJobRunId}" "${exportLog}"
                                    echo "Deploy job exported!"
                                    deployExportLog=$(echo "${logpath}${logname}_deploy_result${outtype}")
                                    blcli_execute Utility exportDeployResults "${jJobKey}" "${jrJobDBKey}" "${deployExportLog}"
                                    echo "Results from: ${deployExportLog}\n"
                                    cat "//@${deployExportLog}"
                                    fi
                                    
                                    
                                    #NSH Script Job
                                    [[ "${jrJobType}" = "393" ]] && blcli_execute Utility exportNSHScriptRun "${jrJobRunId}" "${exportLog}"
                                    
                                    
                                    #Batch Job
                                    if [[ "${jrJobType}" = "394" ]]; then
                                    blcli_execute Utility exportBatchRun "${jrJobRunId}" "${exportLog}"
                                    blcli_execute BatchJobRun getMemberJobRunsByBatchJobRun ${jrJobKey} ${jrJobRunId}
                                    blcli_execute Utility storeTargetObject mbJobRuns
                                    blcli_execute Utility listLength
                                    blcli_storeenv mbLength
                                    echo "mbLength: ${mbLength}"
                                    for k in {0..$((${mbLength}-1))}
                                    do
                                    blcli_execute Utility setTargetObject mbJobRuns
                                    blcli_execute Utility listItemSelect ${k}
                                    blcli_execute Utility setTargetObject
                                    blcli_execute JobRun getJobRunId
                                    blcli_storeenv jrJobRunId
                                    blcli_execute JobRun getType
                                    blcli_storeenv jrJobType
                                    blcli_execute JobRun getJobKey
                                    blcli_storeenv jrJobKey
                                    blcli_execute JobRun getDBKey
                                    blcli_storeenv jrJobDBKey
                                    blcli_execute JobRun getJobName
                                    blcli_storeenv jrJobName
                                    blcli_execute Utility getTargetObject
                                    blcli_storeenv curTargetObject
                                    blcli_execute Job getGroupId ${jrJobKey}
                                    blcli_storeenv jGroupID
                                    blcli_execute Group getAQualifiedGroupName "5005" "${jGroupID}"
                                    blcli_storeenv gGroupName
                                    blcli_execute Job findByDBKey ${jrJobKey}
                                    blcli_execute Job getJobKey
                                    blcli_storeenv jJobKey
                                    blcli_execute Job getDBKey
                                    blcli_storeenv jJobDBKey
                                    blcli_execute Utility getTargetObject
                                    blcli_storeenv cur1TargetObject
                                    wait
                                    echo "\n#################################\n"
                                    echo "jrJobRunId: ${jrJobRunId}\n"
                                    echo "jrJobKey: ${jrJobType}\n"
                                    echo "jrJobKey: ${jrJobKey}\n"
                                    echo "jJobDBKey: ${jJobDBKey}\n"
                                    echo "jrJobDBKey: ${jrJobDBKey}\n"
                                    echo "jrJobName: ${jrJobName}\n"
                                    echo "curTargetObject: ${curTargetObject}\n"
                                    echo "cur1TargetObject: ${cur1TargetObject}\n"
                                    echo "jJobKey: ${jJobKey}\n"
                                    echo "jGroupID: ${jGroupID}\n"
                                    echo "gGroupName: ${gGroupName}\n"
                                    
                                    
                                    logname=$(echo "${datetime}_${jrJobType}_${jGroupID}_${jrJobName}") 
                                    exportLog=$(echo "${logpath}${logname}${outtype}")
                                    
                                    
                                    echo "logname: ${logname}\n"
                                    echo "exportLog: ${exportLog}\n"
                                    jobLogs
                                    done
                                    fi
                                    
                                    
                                    #Deploy Job Attempt
                                    [[ "${jrJobType}" = "385" ]] && blcli_execute Utility exportDeployRun "${gGroupName}" "${jrJobName}" "${jrJobRunId}" "${exportLog}"
                                    
                                    
                                    #File Deploy Job
                                    if [[ "${jrJobType}" = "395" ]]; then
                                    blcli_execute JobResult findByJobRun ${jrJobDBKey}
                                    blcli_storeenv mjJobRunResultKey
                                    blcli_execute Utility storeTargetObject jobResult1
                                    blcli_execute Utility setTargetObject jobResult1
                                    blcli_execute JobResult getDBKey
                                    blcli_storeenv jobResultDBKey
                                    blcli_execute JobResult getJobRunId
                                    blcli_storeenv jobResultJobRunId
                                    blcli_execute JobResult getJobResultKeyByJobRunId ${jobResultJobRunId} 0
                                    blcli_storeenv fdjResultKey
                                    echo "File Deploy ResultKey: $fdjResultKey"
                                    fi
                                    
                                    
                                    #Provision Job
                                    [[ "${jrJobType}" = "396" ]] && blcli_execute Utility exportProvisionRun "${jrJobRunId}" "${exportLog}"
                                    
                                    
                                    #Compliance Job
                                    [[ "${jrJobType}" = "5108" ]] && blcli_execute Utility exportFullComplianceRun "${jGroupID}" "${jrJobName}" "${jrJobRunId}" "${exportLog}"
                                    
                                    
                                    #Update Server Property Job
                                    # [[ "${jrJobType}" = "386" ]] && 
                                    #ACL Push Job
                                    # [[ "${jrJobType}" = "399" ]] && 
                                    
                                    
                                    echo "\nResults from job name: ${jrJobName}\n"
                                    
                                    
                                    blcli_execute JobRun getLogItemsByJobRunId "${jrJobKey}" "${jrJobRunId}"
                                    blcli_storeenv logmessages
                                    echo "$logmessages"
                                    
                                    
                                    if [[ -f //@${exportLog} ]]; then
                                    echo "\nJobRun Log for: ${jrJobName}\n"
                                    cat "//@${exportLog}"
                                    wait
                                    #rm "${exportLog}"
                                    else
                                    echo "\nNo exported log found for job name: ${jrJobName}"
                                    fi
                                    }
                                    
                                    
                                    SERVER_NAME=$NSH_RUNCMD_HOST
                                    
                                    
                                    datetime=$(date '+%Y%m%d-%H.%M.%S')
                                    logpath="/tmp/"
                                    outtype=".csv"
                                    #brProfile="NSH"
                                    #brRole="G444"
                                    tlBatchJob="/R&D Applications/General Applications/upgrade/rhel_upgrade"
                                    
                                    
                                    blcli_setjvmoption -Dcom.bladelogic.cli.execute.quietmode.enabled=true
                                    #blcli_setoption serviceProfileName "${brProfile}"
                                    #blcli_setoption roleName "${brRole}"
                                    #blcli_connect
                                    
                                    
                                    blcli_execute BatchJob getDBKeyByGroupAndName "${tlBatchJob%/*}" "${tlBatchJob##*/}"
                                    blcli_storeenv jobDBKey
                                    blcli_execute Job executeAndWaitAgainstServers "${jobDBKey}" "${SERVER_NAME}"
                                    blcli_storeenv jobRunKey
                                    blcli_execute Utility storeTargetObject jobRunKeyTgt
                                    blcli_execute Utility setTargetObject jobRunKeyTgt
                                    blcli_execute JobRun getJobName
                                    blcli_storeenv tlBatchJobName
                                    blcli_execute JobRun getJobRunId
                                    blcli_storeenv tlBatchJobRunId
                                    blcli_execute JobRun getJobKey
                                    blcli_storeenv tlBatchJobKeyForRun
                                    blcli_execute JobRun getDBKey
                                    blcli_storeenv tlBatchJobDBKey
                                    blcli_execute Job findByDBKey ${jobDBKey}
                                    blcli_execute BatchJob isByStage
                                    blcli_storeenv byStage
                                    echo "###################################\n"
                                    echo "jobDBKey: ${jobDBKey}\n"
                                    echo "jobRunKey: ${jobRunKey}\n"
                                    echo "tlBatchJobName: ${tlBatchJobName}\n"
                                    echo "tlBatchJobRunId: ${tlBatchJobRunId}\n"
                                    echo "tlBatchJobDBKey: ${tlBatchJobDBKey}\n"
                                    echo "tlBatchJobKeyForRun: ${tlBatchJobKeyForRun}\n"
                                    echo "byStage: ${byStage}\n"
                                    
                                    
                                    blcli_execute BatchJobRun getMemberJobRunsByBatchJobRun ${tlBatchJobKeyForRun} ${tlBatchJobRunId}
                                    blcli_execute Utility storeTargetObject tlBatchJobRuns
                                    blcli_execute Utility listLength
                                    blcli_storeenv tlBatchLength
                                    echo "\ntlBatchLength: ${tlBatchLength}\n"
                                    blcli_execute Utility setTargetObject tlBatchJobRuns
                                    blcli_execute Utility listPrint
                                    blcli_storeenv tlBatchRunTypes
                                    for j in {0..$((${tlBatchLength}-1))}
                                    do
                                    echo "###################################\n"
                                    blcli_execute Utility setTargetObject tlBatchJobRuns
                                    blcli_execute Utility listItemSelect ${j}
                                    blcli_execute Utility setTargetObject
                                    blcli_execute JobRun getJobRunId
                                    blcli_storeenv jrJobRunId
                                    blcli_execute JobRun getType
                                    blcli_storeenv jrJobType
                                    blcli_execute JobRun getJobKey
                                    blcli_storeenv jrJobKey
                                    blcli_execute JobRun getDBKey
                                    blcli_storeenv jrJobDBKey
                                    blcli_execute JobRun getJobName
                                    blcli_storeenv jrJobName
                                    blcli_execute Utility getTargetObject
                                    blcli_storeenv curTargetObject
                                    blcli_execute Job getGroupId ${jrJobKey}
                                    blcli_storeenv jGroupID
                                    blcli_execute Group getAQualifiedGroupName "5005" "${jGroupID}"
                                    blcli_storeenv gGroupName
                                    blcli_execute Job findByDBKey ${jrJobKey}
                                    blcli_execute Job getJobKey
                                    blcli_storeenv jobKey
                                    blcli_execute Utility getTargetObject
                                    blcli_storeenv cur1TargetObject
                                    echo "jrJobRunId: ${jrJobRunId}\n"
                                    echo "jrJobType: ${jrJobType}\n"
                                    echo "jrJobKey: ${jrJobKey}\n"
                                    echo "jrJobDBKey: ${jrJobDBKey}\n"
                                    echo "jrJobName: ${jrJobName}\n"
                                    echo "curTargetObject: ${curTargetObject}\n"
                                    echo "cur1TargetObject: ${cur1TargetObject}\n"
                                    echo "jobKey: ${jobKey}\n"
                                    echo "jGroupID: ${jGroupID}\n"
                                    echo "gGroupName: ${gGroupName}\n"
                                    
                                    
                                    logname=$(echo "${datetime}_${jrJobType}_${j1GroupID}_${jrJobName}") 
                                    exportLog=$(echo "${logpath}${logname}${outtype}")
                                    
                                    
                                    echo "logname: ${logname}\n"
                                    echo "exportLog: ${exportLog}\n"
                                    
                                    
                                    jobLogs
                                    
                                    
                                    done
                                    
                                    1 2 Previous Next