Search code examples
cronuipath

Cron expression for 10 AM on Monday to Friday except last day of month


0 0 10 ? * MON,TUE,WED,THU,FRI *

This is 10 AM on Monday to Friday.
Is it possible to set except the last day of month for the expression above?


Solution

  • Maybe with 3 rules:

    0 0 30 4,6,9,11        *
    0 0 31 1,3,5,7,8,10,12 *
    0 0 28 2               *
    

    Or simply on the first of each month:

    0 0 1 * *