springspring-mvcsap-commerce-cloudhybris-data-hub

Cron expression to trigger at everyday 12am and 12pm in Hybris


I am trying to trigger a crobjob in Hybris to trigger twice in a day (12am and 12pm). I am trying to update the trigger like below, but getting error invalid. any help?

cronExpression '0 */12 * * *' was invalid Unexpected end of expression.
INSERT_UPDATE Trigger; cronJob(code)[unique=true]; active;cronExpression
                     ; newTestCronJobOrderfi;true;0 */12 * * *
INSERT_UPDATE Trigger; cronJob(code)[unique=true]; active;cronExpression
                     ; newTestCronJobOrderfi;true;0 */12 * * *

Solution

  • This is because you expression is definitely not a valid cron expression. Check the documentation for details (very complex and lengthy). Cron has 7 fields: second, minute, hour, day of months, months, day of week, year. Only "year" is optional, thus any expression must either have 6 entries (w/o year) or 7 (with year).

    Your expression has only 5 entries...

    Try: 0 0 */12 * * ?