1

I am trying to understand when this trigger runs in Jenkins groovy script. Seems to me that Jenkins groovy script has some DSL for cron. Does anyone know when this cron job is triggered?

triggers {
cron('H 5 * * 7')
}
Ayman Patel
  • 564
  • 2
  • 8
  • 23

2 Answers2

3

In H 5 * * 7 the H means hash. You can have digit in the first place, but H allows to distribute the load better.

H = minute when less load is expected, Jenkins will propose it the first time, after that it will stay more or less the same, if there are available agents to handle it.
5 = hour,
* = any value (every day),
* = any value (every month),
7 = 7th day of week (Sunday).

Reference: Spread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’

K. B.
  • 3,342
  • 3
  • 19
  • 32
2

You can test it using the CRONTab tester. This means to start at 5:00 on every sunday

https://crontab.guru/#0_5_*_*_7
Kaveesh
  • 388
  • 6
  • 14