Jenkins CRON Job Scheduling
Hello World,
In this article, you will learn the Jenkins CRON Job scheduling.
Jenkins provides the scheduling to trigger your job automatically at/on the configured time schedule.
Description of Values (5 stars)
Jenkins scheduling supports 5 values, let's know about those
(Most left) * * * * * (Most Right)
or (in another way these stars can also be represented as)
MINUTE HOURS DATES MONTHS DAYS
I am starting from the most left.
1st *: This is for the Minutes. and it has the range of (0-59). It also supports the division and the outcome will be treated as modulo division.
For Example, if you have written H/3 at the 1st * place then every minute value, which is completely divisible by 3 your job will be triggered.
2nd *: This is the hours, and it has the range of (0-23). It also supports the division.
3rd *: This is the Dates(Month days), and it has the range of (1-31).
4th *: This is the Month, and it has the range of (1-12).
5th *: This is the Weekdays, and it has the range of (0-6).
* and H
Now, you might be thinking about * and H, what are these? Are these same? because we are using it to achieve the fully dynamic time.
Well, both are working same, with a very little difference which is queue balancing. means when we use */10 it means as soon as found the value of H fully divisible by 10 then trigger the job, no matter how many queues Jenkins is having. It will create another queue.
but when we use H/10, it means as soon as the value of H found which is fully divisible by 10, AND there is no any extra load at this time on Jenkins then trigger the job.
Various styles of scheduling.....
Single Line Job Scheduling: For the simple scheduling.
- Schedule a task to execute on every 10 minutes
H/10 * * * *
Multi-Line Job Scheduling: For the complex scheduling.
Example:
- Stop a Jenkins job build at 10PM-12AM every 1st day of Month, Script runs in every 10 Mins
H/10 * 2-31 * *
H/10 0-22 1 * *
I hope it helps to understand the Jenkins scheduling.
Thanks for the reading.
Do comment for further questions.
In this article, you will learn the Jenkins CRON Job scheduling.
Jenkins provides the scheduling to trigger your job automatically at/on the configured time schedule.
Description of Values (5 stars)
Jenkins scheduling supports 5 values, let's know about those
(Most left) * * * * * (Most Right)
or (in another way these stars can also be represented as)
MINUTE HOURS DATES MONTHS DAYS
I am starting from the most left.
1st *: This is for the Minutes. and it has the range of (0-59). It also supports the division and the outcome will be treated as modulo division.
For Example, if you have written H/3 at the 1st * place then every minute value, which is completely divisible by 3 your job will be triggered.
2nd *: This is the hours, and it has the range of (0-23). It also supports the division.
3rd *: This is the Dates(Month days), and it has the range of (1-31).
4th *: This is the Month, and it has the range of (1-12).
5th *: This is the Weekdays, and it has the range of (0-6).
* and H
Now, you might be thinking about * and H, what are these? Are these same? because we are using it to achieve the fully dynamic time.
Well, both are working same, with a very little difference which is queue balancing. means when we use */10 it means as soon as found the value of H fully divisible by 10 then trigger the job, no matter how many queues Jenkins is having. It will create another queue.
but when we use H/10, it means as soon as the value of H found which is fully divisible by 10, AND there is no any extra load at this time on Jenkins then trigger the job.
Various styles of scheduling.....
Single Line Job Scheduling: For the simple scheduling.
- Schedule a task to execute on every 10 minutes
H/10 * * * *
Multi-Line Job Scheduling: For the complex scheduling.
Example:
- Stop a Jenkins job build at 10PM-12AM every 1st day of Month, Script runs in every 10 Mins
H/10 * 2-31 * *
H/10 0-22 1 * *
I hope it helps to understand the Jenkins scheduling.
Thanks for the reading.
Do comment for further questions.
Comments
Post a Comment