Wanted CLI command to kill a running job
search cancel

Wanted CLI command to kill a running job

book

Article ID: 201952

calendar_today

Updated On:

Products

CA Workload Automation DE - Business Agents (dSeries) CA Workload Automation DE DSERIES- SERVER CA Workload Automation DE - System Agent (dSeries) CA Workload Automation DE - Scheduler (dSeries)

Issue/Introduction

Can you please share cli command to kill a job if running?

Environment

Release : 12.2

Component : CA WORKLOAD AUTOMATION DE (DSERIES)

Resolution

There is no CLI command to kill a running job. However, you can cancel a running job depending on the job type or send a signal to Unix job to kill the process.

Also, you can set up an Overdue condition on the job and run an Alert to cancel or complete the job when it runs more than the anticipated time as below:

1. Define an Alert in Services perspective to run a JavaScript to cancel or complete the job using the execCommand JavaScript function

To cancel the job:

execCommand('%WOB._name','%(APPL._name).%APPL._gen','ACTION KILL');

Or 

To complete the job;

execCommand('%WOB._name','%(APPL._name).%APPL._gen','ACTION COMPLETE');

2. Set up an Alert Notification in the job to monitor for Overdue condition and specify the Alert name defined in step (1)

3. In the job's Time Dependencies, specify when the job is Mark as overdue when -> Not completed by: time.


Related docs:

Cancel a Running Job

Send a Signal to a UNIX Job

Complete an Application if a Job is Overdue