I need to schedule a jenkins job each 15 minutes.
Currently i'm using the Build periodically
feature but that enables me to schedule the job once in 1 hour maximum.
What i got now is:
15 * * * *
is running the job HOURLY (each XX:15)
15 0 * * *
is running the job DAILY on 00:15
What is the right cron-expression that will run the job every 15 minutes?
A job that runs every 15 minutes has H/15 in the first field. Note that the H in the first field has a special meaning. If you wanted a job to run every 15 minutes, you could configure it as 0/15, which would make it run at the start of every hour.
The steps for schedule jobs in Jenkins:click on "Configure" of the job requirement. scroll down to "Build Triggers" - subtitle. Click on the checkBox of Build periodically. Add time schedule in the Schedule field, for example: @midnight.
In the Build Triggers section, instead of selecting Build Periodically, let's select Poll SCM. As soon as we do that, we should see a text box with Label Schedule. Let's type */5 * * * * in this box, which means we want to schedule the job to run every 5 minutes: Let's scroll up to Source Code Management section.
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.
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