In Jenkins we have the Poll SCM schedule set to * * * * *
. But Jenkins suggests Do you really mean "every minute" when you say "* * * * *"? Perhaps you meant "0 * * * *"
Is there any difference between * * * * *
and 0 * * * *
?
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.
CRON in JenkinsIn the Jenkins job's “Configure” option, we'll want to navigate to the “Build Trigger” tab, where we'll see the checkboxes for “Poll SCM” and “Build Periodically.” These are the options where we must be familiar with CRON syntax and its function to configure our Jenkins Build.
Add a Schedule to a Jenkins Job 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. Enter H/5 * * * * into the box, click Save, and reopen the configuration.
Of course there is a difference!
0 * * * *
- is every hour, when minute == 0.(i.e. 1:00, 2:00,..)
* * * * *
- is every minute
Check out the guide for more info.
Every fifteen minutes (perhaps at :07, :22, :37, :52)
H/15 * * * *
Every ten minutes in the first half of every hour (three times, perhaps at :04, :14, :24)
H(0-29)/10 * * * *
Once every two hours at 45 minutes past the hour starting at 9:45 AM and finishing at 3:45 PM every weekday.
45 9-16/2 * * 1-5
Once in every two hours slot between 9 AM and 5 PM every weekday (perhaps at 10:38 AM, 12:38 PM, 2:38 PM, 4:38 PM)
H H(9-16)/2 * * 1-5
Once a day on the 1st and 15th of every month except December
H H 1,15 1-11 *
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