Saturday, 5 November 2016

How to set up cron job in Jenkins?

Q.65 How to set up cron job in Jenkins?

Setting up the cron jobs in Jenkins using "Build periodically" - scheduling the jenkins Job
A CRON expression is a string comprising five or six fields separated by white space that represents a set of times, normally as a schedule to execute some routine.
Format
Field name
Mandatory?
Allowed values
Allowed special characters
Remarks
Dayof week, day of month, minutes, hours, seconds, month, years
Yes for except years
Standard value for each type
* / , - ? L # W

Examples - 
To schedule your build every 5 minutes, this will do the job : */5 * * * * OR H/5 * * * *
To schedule your build start at midnight - 59 23 * * 1-5 OR @midnight
To run a job on 9.30p.m. (at night) on 3rd of May then I ll write or 21.30 on 3/5/2011 - 21 30 3 5 *

Every fifteen minutes (perhaps at :07, :22, :37, :52) 0 - H/15 * * * *

1 comment:

  1. I tried over to set cron job in jenkins but not succeed by following your post I done it thank you. The Lucidtechsystems providing quality online and classroom Build and release engineer training in Hyderabad from real time experts.

    ReplyDelete

Tricks and Tips