Create a Custom Scheduled Job
From OpenCms Wiki
A scheduled job is a bit of code that is run on a regular basis by OpenCms. You can create custom scheduled jobs by creating a java class that implements I_CmsScheduledJob.
Then you add your Java class to OpenCms. You can either create a jar file, or a class file. Then you add them to your OpenCms installation - your options are on the Adding_Jar_Files page.