CMDBuild Forum

Custom Weekly Cron not working?

I’m trying to create a scheduled task to run on Sundays at midnight. I’m using the advanced expression editor and neither “0 0 * * 0”, “0 0 * * 1”, "“0 0 * * Sun” work. When I look at the logs I see

org.cmdbuild.utils.sked.SkedException: error processing trigger for job =< SkedJob{code=jobs.ADUsersImport} >
...
Caused by: java.lang.RuntimeException: CronExpression '0 0 0 * * 0' is invalid.
...
Caused by: java.text.ParseException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.

First, I’m not sure which cron convention is being used for day of the week. Is it 0-6, 1-7, Sat-Sun?
Second, I know I’m not supposed to use fifth and sixth params, nonetheless, the logs says I’m using both. Are we missing a field in the advanced cron UI form that it is somehow getting preset in the back end?

How I interpret your cron:
Day of week: Sunday
Day of month: Every day
Which of cause can’t be scheduled.
Try using ‘?’ instead of ‘*’ for Day of month if you want to run your jobs every Sunday, no matter the what date it is.

So “0 0 ? * 1”
I’ll give that a try and let you know on Monday.
Thanks

1 Like