Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure cron job to run every 15 minutes on Jenkins

Tags:

unix

cron

jenkins

How can I run a cron job every 15 mins on Jenkins?

This is what I've tried :

On Jenkins I have a job set to run every 15 mins using this cron syntax :

14 * * * * 

But the job executes every hour instead of 15 mins.

I'm receiving a warning about the format of the cron syntax :

Spread load evenly by using ‘H * * * *’ rather than ‘14 * * * *’ 

Could this be the reason why the cron job executes every hour instead of 15 mins ?

like image 784
blue-sky Avatar asked Oct 18 '13 07:10

blue-sky


People also ask

How do I schedule Jenkins to run every 15 minutes?

To run the job at a regular interval of 15 minutes you have to write it like below: */15 * * * * - Will run at every 15 minutes (may be at XX:01,XX:16,XX:31 ..) Where */15 specifies no matter whatever is Hour (H) run it at 15 every minutes.

How do I run a cron job every 20 minutes?

Instead of a range of values, you can also use the asterisk operator. To specify a job to be run every 20 minutes, you can use “*/20”.

How do I schedule a Jenkins job to run every minute?

Add a Schedule to a Jenkins JobHead back to the job configuration and click the Build Triggers tab. Now, check the Build periodically box in the Build Triggers section. This will open the scheduling text area. Next, let's set the job to run every five minutes.


1 Answers

Your syntax is slightly wrong. Say:

*/15 * * * * command   |   |--> `*/15` would imply every 15 minutes. 

* indicates that the cron expression matches for all values of the field.

/ describes increments of ranges.

like image 197
devnull Avatar answered Sep 19 '22 13:09

devnull