We will look at Jenkins Cron scheduling in this blog entry.
Jenkins Cron Scheduling
First of all what is Cron? Cron is a Unix based scheduling system that helps us define a time stamp which can represent time of day, time of year, day of month etc.
In Jenkins the time is split into 5 sections:
Minutes [0-59] Hour [0-23] Day of Month [1-31] Month of Year [1-12] Day of Week [0-7] (both 0 and 7 present Sunday)
Each number above represent their given range of value and in the event you want to use any value then you use *. So in the event you want to present 8:30am for any given day of the year then you can do this like so:
30 8 * * *
Setting a Cron Schedule in a Jenkins Jobs
Navigate to Jenkins and configure an existing project. Now under the build trigger section you should see a Build on Schedule option. Tick it and this will open a text field box. Inside the text field box enter the value of the time you want to run but express the time in Cron format.
And there you go, you can now automatically run your Jenkins job using a Cron time.
Follow the video tutorial below to see a more detailed view of this blog.