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
SIVASASNKARSIVASASNKAR 

Schedule the apex class to run every 2 two days( even days(2,4,6..) or odd days(1,3,5...))

Hi Experts,

I would like to schedule an apex class to run every 2 day ( even days 2,4,6,8... or odd days 1,3,5,7...), can any one help me to write cron expression for this. Please let me know in case if you required any more informaiton. I have alternative solution, but I would expecting direct cron expression for this.

Immidiate answers would be appriciated.

Thank you,
Sivasankar K.
Best Answer chosen by SIVASASNKAR
Arunkumar RArunkumar R
Hi Sivasankar, 

You can also use the below cron expression,

0 0 12 1/2 * ? *

FYI, There is one website available to build CRON expression. You don't need to spend too time on this. Go to the below site and enjoy.

http://www.cronmaker.com/

All Answers

SIVASASNKARSIVASASNKAR
Hi All,

I found the answer for this scenario..,I hope it will help for others.
'0 0 6 */2 * ?'

For more information please click here (http://stackoverflow.com/questions/4549542/cron-job-every-three-days)

Thanks,
Sivasankar K.
Jayant JadhavJayant Jadhav
Hi SIVASASNKAR,

Try below cron expression. This will execute at 4.20 PM starting from today i.e 27 and next schedule will be on 29 and goes on.
0 20 16 27/2 * ?   

what is 27/2 :
The number before the slash specifies when the intervals will begin, and the number after the slash is the interval amount. For example, if you specify 27/2 for Day_of_month, the Apex class runs every second day of the month, starting on the 27 of the month.
Arunkumar RArunkumar R
Hi Sivasankar, 

You can also use the below cron expression,

0 0 12 1/2 * ? *

FYI, There is one website available to build CRON expression. You don't need to spend too time on this. Go to the below site and enjoy.

http://www.cronmaker.com/
This was selected as the best answer
SIVASASNKARSIVASASNKAR

Hi Jayant and Arunkumar,

Thanks you very much for your valuable information.

Thanks,
Sivasankar.