Reputation: 13
how to add JENKINS CRON Expression for every Sunday 2 am .
I used expression like
H 2 * * 0
but it is triggering @ 2:30am instead of 2am
Upvotes: 0
Views: 2082
Reputation: 2636
this is the correct format 0 2 * * 0 ( the first 0
digit is the minute)
you can read some more at http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/
Thanks
Upvotes: 0
Reputation: 111555
If you want a job to build every Sunday at 2:00 AM exactly, you should use this syntax:
0 2 * * 0
i.e. at minute 0, of hour 2.
But in general when scheduling tasks with Jenkins, it's a good idea to use the H
parameter in order to ensure that lots of jobs don't all start at exactly the same time, like on the hour. Using H
spreads out the load between jobs, to avoid overwhelming the server.
As you've seen, using H 2 * * 0
may start at any time between 2 and 3 AM. Though for one job, the execution time will remain the same, e.g. always 2:30. Jenkins tells you below the cron textbox when it will execute next.
Upvotes: 1