Cron Trigger Input Error

Issue #160 wontfix
Jennifer Kanngard created an issue

HI I am trying to set trigger details for a scheduling task by using the advanced functionality and cron trigger input.

I ideally want a task to be performed for the first 10 business days of any month and for the trigger to be at 6am every morning.

I have tried the following but keep getting error messages:

0 0 6 1-17 * 2-6 0 0 6 1-17 * MON-FRI

Please can you help? How can I enter intervals within a month in the scheduling tool?

Comments (1)

  1. Łukasz Modzelewski

    Hi Jennifer,

    Unfortunately you can not combine days of the month with days of the week, it's not supported by Cron Triggers. You can read about it in similar use cases:

    http://stackoverflow.com/questions/34357126/why-crontab-uses-or-when-both-day-of-month-and-day-of-week-specified and http://stackoverflow.com/questions/4455970/is-this-cronexpression-correct/4834940#4834940

    But you could achieve same result using 10 triggers (instead of 1) - your scheduled issue should be running on the 1st of that day of the month, and 2nd of that day of the month, Monday - Friday

    0 0 6 ? * 2#1 - first Monday of the month

    0 0 6 ? * 2#2 - second Monday of the month

    ...

    0 0 6 ? * 6#1 - first Friday of the month

    0 0 6 ? * 6#2 - second Friday of the month

    If you would like to test your Cron Expressions you can do it here: http://www.cronmaker.com/

    If it solves your issue please close this ticket.

    Best regards, Łukasz

  2. Log in to comment