I have a batch class which I had scheduled to run every Hours as below:
Batchclass obj = new Batchclass(); String cron = '0 0 0/1 1/1 * ? *'; System.schedule('Batchclass Job',cron,obj);
But now I want to run it every 30 min. So I tried this cron string :
0 0/30 * 1/1 * ? * but I got error : Seconds and minutes must be specified as integers:
0 0/30 * 1/1 * ? *
So I googled a bit and found a solution where I have to run 2 jobs to achieve this as below:
Batchclass obj = new Batchclass(); System.schedule('Batchclass Job1', '0 0 * * * ?',obj); System.schedule('Batchclass Job2', '0 30 * * * ?',obj);
But this solution will create 2 Batch jobs which i am hoping to avoid. Any Solutions?