function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pjonnapjonna 

cron expression to run weekly

I used below cron expression to schedule my job weeky to run at 1 AM.  I dont see anything wrong the below cron expression

'0 1 ? * 0 *'

I get this exception

'?' can only be specified for Day-of-Month or Day-of-Week.. Can anyone tell what is the correct for this.

Best Answer chosen by Admin (Salesforce Developers) 
pjonnapjonna

Ok. I was looking at cron from unix...it is missing seconds. I believe salesforce includes seconds sp i have to add 0 before...

 

I working weekly is 0 0 1 ? * 0 *