puchu
puchu

Reputation: 69

Schedule job to run periodically

I am trying to run Jenkins job everyday at 10 AM and 10 PM . How do i do that?

Currently i use the below to run at 12 AM and 12 PM . Am not aware how to change it.

 0 0-23/12 * * *

Upvotes: 1

Views: 709

Answers (3)

Abhishek Anand
Abhishek Anand

Reputation: 76

Suppose you want to run a jenkins job at 4:30 AM , monday to saturday, then you can use below script under your jenkins build trigger:

30 04 * * 1-6

1-6 denotes monday to saturday

Coming back to your question, you can configure 2 entries under your build trigger to run Jenkins job everyday at 10 AM and 10 PM in jenkins as shown below:

00 10 * * 1-7

00 22 * * 1-7

Upvotes: 0

David M. Karr
David M. Karr

Reputation: 15235

Just click the "?" icon to the right of the "Schedule" field, and you'll see a detailed explanation of the syntax available there.

If you want it to run at 12am and 12pm, I would guess you would just do this:

0 0,12 * * *

Upvotes: 0

Amit
Amit

Reputation: 32386

Its difficult to acheive it with just a single crontab entry, what you can do is to have a 2 crontab entry like below :-

for job which you want to run daily at 10 AM :-

0 10 * * *

And for 10 PM job 0 22 * * *.

Here first entry denotes the minute, second denotes the hour and then day,month and week.

Upvotes: 1

Related Questions