How to Schedule an Apex Class to run every 30 minutes?

12:45 PM


Execute the following two blocks of code separately from the developer console. The system will create two jobs, one which runs every 0th minute (1PM 2PM 3PM etc) and one which runs every 30th minute (1:30PM 2:30PM 3:30PM etc)



ClassName gp = new ClassName();
String cronStr = '0 0 * * * ?';
System.schedule('Job which runs at every 0th minute of hour', cronStr, gp);


ClassName gp = new ClassName();
String cronStr = '0 0 * * * ?';
System.schedule('Job which runs at every 30th minute of hour', cronStr, gp);

0 comments