0

I just want to run the job twice per week. Every Sunday 11 PM and every Friday 11 pm I just want to trigger the job automatically. I successfully implemented for one scheduler but not sure how to use two in single .

    Sunday scheduler :

      H 11 * * 0 

    Friday scheduler:

      H 11 * * 6
Cœur
  • 37,241
  • 25
  • 195
  • 267
ArrchanaMohan
  • 2,314
  • 4
  • 36
  • 84

2 Answers2

1

For scheduling the job below pattern need to be followed:-

0 - Sun      Sunday
1 - Mon      Monday
2 - Tue      Tuesday
3 - Wed      Wednesday
4 - Thu      Thursday
5 - Fri      Friday
6 - Sat      Saturday
7 - Sun      Sunday

For your case you can follow the below:-

0 23 * * 0,5

You better understanding of "H" in Jobs Scheduler follow this:

user_9090
  • 1,884
  • 11
  • 28
0

Maybe something like this. Note there's a couple changes from your example, changed 11 to 23, 11 is 11am, 23 is 11pm and using 5 instead of 6 for Friday.

H 23 * * 0,5

But note with the "H" it isn't going to run at exactly 11pm, from the Jenkins docs:

The H symbol can be thought of as a random value over a range, but it actually is a hash of the job name, not a random function, so that the value remains stable for any given project.

If you want it to run closer to 11pm, maybe something like this

H(1-5) 23 * * 0,5
Brad Albright
  • 686
  • 7
  • 12