Kill Job after at 08:00 every day

All questions about Control-M jobs definitions
Post Reply
User avatar
osafr71
Nouveau
Nouveau
Posts: 26
Joined: 21 Jan 2010 12:00

Kill Job after at 08:00 every day

Post by osafr71 » 22 Jan 2013 1:38

Hi people, i need some information. I need to kill a job every day at 08:00 AM, but yhe problem is i don't know when it start's. If the job was executin fixed for example at 04:00 AM, i could use the ctmkill job option after 4 hours, but the problem s that i never know when it start's, only when it must end.
Any solution or workaround?

Thanks

osafr71

User avatar
Phils
Nouveau
Nouveau
Posts: 7
Joined: 28 May 2008 12:00

Post by Phils » 24 Jan 2013 4:03

BIM ?
On event "Service is late" -> Do kill-Job

User avatar
MeN5Girls
Nouveau
Nouveau
Posts: 3
Joined: 19 Sep 2012 12:00

Post by MeN5Girls » 24 Jan 2013 5:53

1. Set up a 'shout' destination that maps to a 'p' (for program) on the Control-M Server.
2. On Unix your shout destination script would be something like this -

#! /bin/csh
ctmkilljob -ORDERID $2 &
ctmshout -ORDERID $2 -USER ECS -MESSAGE "Long running job killed" -SEVERITY R &

The first line does the cancel, the second line will send an alert to the ECS console.

3. On the Post Processing panel put this destination in the 'to' field and (importantly) have the message field as just %%ORDERID - then fill in the 'when' and 'param' fields as desired (e.g. Late Time = 0800 means the job will issue the cancel at 8:00 AM).

User avatar
ThePirate
Nouveau
Nouveau
Posts: 61
Joined: 04 Feb 2008 12:00
Location: Cleveland, OH

Post by ThePirate » 24 Jan 2013 8:30

On windows:
1. Set up a 'Shout Destination' with 'Logical Name' as "KILLJOB", "S" for 'Adress', "Program" for 'Destination', and "D:\Production\KillJob.bat" for value.

2. KillJob.bat script is below.

cmd /C ctmkilljob -orderid %2

3. On the Post Processing panel put KILLJOB in the 'To' field, put %%ORDERID in the 'Message' field, select "Late Time" in the 'When' field and put 0800 in the 'Param' field.

Post Reply