Shashi Kumar Raja
Shashi Kumar Raja

Reputation: 518

Schedule periodic builds in jenkins till a specific date

I want to schedule periodic build in jenkins which should run once daily at 9 am till a specific day (example, if today is 1st of dec then it should run from 1st to 7th of dec only)

For running every day at 9 am the script is-

H 9 * * *

What should I add to run it till specific date only?

Upvotes: 0

Views: 1479

Answers (1)

Pieter Meiresone
Pieter Meiresone

Reputation: 2062

Cron expressions support range selectors. For your specific example, you can specify that it should run from the 1st to 7th of december only:

* 9 1-7 12 *

“At 09:00 on every day-of-month from 1 through 7 in December.”

You can easily test your expression here. Since you can't specify the year in a cron expression, you will have to remove trigger manually afterwards.

Upvotes: 1

Related Questions