Introduction
By default, the minimal execution’s interval of a cyclic job is 1 minute (with the rerun every 0 sec option it will loop instantaneously).
But what happens when you need to rerun it in a interval between 0 and 1 minute?
Let’s use a little trick to achieve that
Job configuration
- In planning pane create a job
- When selecting this job, go in “scheduling” tab part and tick the “cyclic” box
Result:
As soon as you define your job as cyclic it will take the default configured value and rerun every (1) minutes from job’s start
- We will update this part by switching to 0 minute(s) from Job’s start (be careful about using cyclic job to 0 )
- We also will keep the maximum rerun at 0 for our test
Using sleep command and Control-M/Agent _sleep utility
Depending of the OS where agent is installed, you can use these two commands:
For Windows OS
You have to use the Control-M/Agent _sleep utility (time in sec)
Definition from Control-M Help ( available on your Control-M workload automation client opening file/help/view help )
For Unix/Linux OS
the sleep command with time needed in second
[ctmag900@CTMSRVCENTOS ~]$ sleep 30 [ctmag900@CTMSRVCENTOS ~]$¨
As we are on a Linux machine, we will use the sleep built-in shell function from UNIX.
We will add it to “post-execution” or “pre-execution” command part
(Note: On older Control-M version (before 8.0.00) it was named pre-cmd and post-cmd)
In our example we have scheduled the job to be executed every 30 sec by using the below syntax
sleep 30
Order job and check log
Having a look on the submission intervals, it appears that we have the expected result ,with job executing every 30 sec
Note:
You can have a slight delay depending of the response time of your machine where the task is running
Conclusion
You are now able to perform cyclic jobs in less than 1 minute intervals by using this tip.
To get more information, you can consult BMC’s site and of course don’t forget to check dbi’s blogger for more tips and tricks!