How to Schedule a Jenkins Job
Jenkins Job Schedule Syntax
To begin with, we should take a gander at the Jenkins job scheduling configuration. It seems to be Linux’s cron syntax, however you don’t need to be know all about command line Linux to sort it out.
A scheduling entry comprises of five whitespace-separated fields. You can schedule a job for more than one time by adding more than one entry.
MINUTE |
HOUR |
DAY |
MONTH |
DAY OF THE WEEK |
---|
MINUTE (0-59), HOUR (0-23), DAY (1-31), MONTH (1-12), DAY OF THE WEEK (0-6)
Each field can contain an specific values and also a set of special expressions
The asterisk * indicates valid values. So, a job that runs every day
In below table they are some special predefined values which can be used to substitute the expressions in jenkins cron.
Macro |
Equivalent |
Description |
---|---|---|
@hourly |
H * * * * |
Run at time during the hour |
@daily |
H H * * * |
Run at time during the day |
@weekly |
H H * * H |
Run at time during the week |
@montly |
H H H * * |
Run at time during the month |
@midnight |
H H(0-2) * * * |
Run between 12:00 am to 2:59 am |
@annually |
H H H H * |
Run at time during the year |
@yearly |
H H H H * |
Run at any time during the year |
How Do I Schedule Jobs In Jenkins?
Jenkins, an open-source automation server, engages teams to automate different tasks, from building and testing to deploying software. One crucial part of Jenkins is its capacity to plan occupations, empowering the execution of mechanized processes at specified intervals of time. This guide gives insights into the significance of scheduling jobs inside Jenkins, permitting users to smooth out dull errands, improve efficiency, and layout ceaseless incorporation and delivery practices.
Scheduling jobs in Jenkins includes defining when explicit automation undertakings should run, whether it’s every day builds, daily deployments, or other customized schedules. Through the configuration of build triggers and the utilization of cron articulations, users can fit work timetables to accommodate their advancement needs. This guide expects to demystify the interaction, enabling clients to harness the maximum capacity of Jenkins for proficient and automated software development.