You can use the System.schedule method, which takes a cron string to represent the repeating time.
Execute below code to run batch on every 15th minutes of hours.
String CRON_EXP = '0 15 * * * ?';
testSchedule sch = new testSchedule();
system.schedule('Test Schedule', CRON_EXP, sch);
Changes 15 to schedule as your requirement!
For Hourly on 0 minute use below code:
String CRON_EXP = '0 0 * * * ?';
testSchedule sch = new testSchedule();
system.schedule('Test Schedule', CRON_EXP, sch);
0 comments:
Post a Comment