Deleting Old Logs and Jobs

You can schedule the DeleteOldAsyncDataSchedule Apex job to delete old logs and finished jobs. This deletes old jobs and logs that are older than the values set in the Background Process settings custom setting. You can also opt to receive notifications when jobs or logs are deleted successfully. See Background Process Settings.

To schedule the job:

  1. Go to Setup | Custom Code | Apex Classes.
  2. Click Schedule Apex.
  3. Enter a meaningful Job Name.
  4. Enter the Apex Class DeleteOldAsyncDataSchedule.
  5. Choose the frequency that you want the job to run:
    • Weekly. Choose the days of the week on which the job is to run.
    • Monthly. Choose the day of the month either by specifying a number such as day 17 of every month, or by specifying a pattern such as the 3rd Tuesday of every month.
  6. Enter the date range for which the job is to run.
  7. Enter a Preferred Start Time for the job.
  8. Click Save.