cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

CRON String Format

SOLVED
Granite

CRON String Format

I need to run a service for every 30 minutes from 7 AM to 7 PM daily except sunday. How can I configure my scheduler.

My CRON string is 0 0,30 7-19 * * 2-7, I enabled my scheduler and subscription, still I'm unable to run my service. Please help me out from this. Correct me If my CRON string is wrong

1 ACCEPTED SOLUTION

Accepted Solutions

Re: CRON String Format

I found the issue..

This Should be CRON string:- 0 0/30 * ? * MON-SAT *

Either Day of the month or Day of the week should be "?".

If Day of the month - " * " then Day of the week - " ? "

If Day of the month  - " ? " then Day of the week - " * " / " MON-SAT "

 

6 REPLIES 6
Highlighted

Re: CRON String Format

@effpt3 

 

Maybe the post How to set up and configure Schedulers can help here.

It seems that the day of week are not taking numbers but string, so in your case it might be MON-SAT.

 

Hope this helps

Kind regards

Christophe

 

Re: CRON String Format

Hello,

 

Here are some additional details, might be helpful as well: https://www.ptc.com/en/support/article/CS210207

 

Regards,
Constantine

Re: CRON String Format

@effpt3 What exactly do you mean when you say "unable to run my service"? It's never triggered, or triggered at the wrong time? Did you configure correct user to run this service? Can you run it without scheduler under this user? Do you see any errors in logs? Etc.

 

Finally, keep in mind that 7AM and 7PM are in the server timezone.

 

/ Constantine

Re: CRON String Format

My Service is never triggered.I have configured coorect user and there are no error logs.

Re: CRON String Format

ERROR starting: CronExpression '0 0/30 7-19 * * MON-SAT ' is nvalid.

ERROR starting: CronExpression '0 0/30 7-19 * * 2-7' is invalid.


This is the error in my application log. 

Re: CRON String Format

I found the issue..

This Should be CRON string:- 0 0/30 * ? * MON-SAT *

Either Day of the month or Day of the week should be "?".

If Day of the month - " * " then Day of the week - " ? "

If Day of the month  - " ? " then Day of the week - " * " / " MON-SAT "