Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins cron format

Tags:

cron

jenkins

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 * * * * ?

like image 201
Ben George Avatar asked Feb 27 '13 10:02

Ben George


People also ask

What is the meaning of * * * * * In the schedule text box of the build trigger section?

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.

How set Jenkins cron job?

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.

How do I schedule a Jenkins job to run every 5 minutes?

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.


2 Answers

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.

like image 66
Draco Ater Avatar answered Sep 21 '22 06:09

Draco Ater


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 *
like image 27
Sachin Avatar answered Sep 19 '22 06:09

Sachin