xGIx
xGIx

Reputation: 539

Schedule Jenkins Build Execution During Specific Times using Build periodically: (* * * * * *)?

Schedule Jenkins Build Execution During Specific Times using Build periodically: (* * * * * *)?

For example: * * * * * * will execute builds continuously,

Is there a way to use the above approach but to run builds continuously between lets say 9am until 11pm.

Example: Monday: time of execution: 9am until 11pm. Tuesday: time of execution: 9am until 11pm.

Upvotes: 0

Views: 1038

Answers (2)

Monkey D. Luffy
Monkey D. Luffy

Reputation: 321

I think you can use the following cron expression : H 9-23 * * *

To build your own new cron expression keep the following link handy and test in Jenkins: https://www.freeformatter.com/cron-expression-generator-quartz.html

Upvotes: 1

Tom Lord
Tom Lord

Reputation: 28305

To run jobs between 9am - 11pm every day, you could use the following:

* 9-23 * * *

To run jobs between 9am - 11pm only on Monday, you can use:

* 9-23 * * 1

And likewise for Tuesday:

* 9-23 * * 2

This website is a great resource for experimenting with cron job formats, and seeing a "human translation" for the syntax.

Upvotes: 3

Related Questions