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 ?
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.
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”.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With