I wanted to schedule fortnightly job on jenkin . It should run every other Monday . I am not able to figure out the cron expression
I did a little research, and it basically comes down to 3 answers that I can find:
Quick answer: You can't.
Complex answer 1: You could manually put in an entry for every other Sunday on a separate line, but this will run into problems when the year changes
0 0 29 4 *
0 0 13 5 *
0 0 27 5 *
0 0 10 6 *
...
Complex answer 2: Create a cron entry that runs every Sunday, and then use something in your build steps that manually checks (toggles) to solve the "every other" part of the problem. (If you need to do the test before the SCM step, the pre-scm-buildstep plugin might help.)
In your project Configure / Build Triggers / Schedule section you can specify @weekly
That will be executed after midnight the first day of the week, based in you JVM locale.
That's the closest you will get from inside Jenkins. Otherwise you'll need to use some external cron job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With