Search code examples
jenkinscronjenkins-pipelinejenkins-plugins

Issue setting Jenkins cron


I have a Jenkins pipeline job that runs every 15 minutes using the build periodically plugin .

H/15 * * * *

I want my cron to run 24X7 every 15 minutes except between 7pm to 10 pm

I tried the below:

H/15 H(22-19) * * *

But i get the below error when i apply save the changes:

A problem occurred while processing the request.
Logging ID=610f57aa-4455-46e4-9af6-3d5b71e6adf1

If I change this to

H/15 H(19-22) * * *

Then it works but instead of skipping 7pm to 10 pm it works during that time.


Solution

  • You can have a look at this Jenkins issue that looks very similar and is not resolved unfortunately.
    I would suggest to change your cron to:

    H/15 0-19,23 * * *
    

    You can test your expression here and here (but you have to replace H with 0 when testing).