Custom Schedulers

Overview

How to create a custom scheduler for versions 6.3.0 and higher

Scheduler Example

Defining the Job Label

The first step for the scheduler is to create your scheduler label. This will identify the scheduler job when you are defining the job runtimes.
./custom/Extension/modules/Schedulers/Ext/Language/en_us.<name>.php
In this example, my file will be named ‘en_us.custom_job.php’:
./custom/Extension/modules/Schedulers/Ext/Language/en_us.custom_job.php
This file will contain the following label information:
<?php
    $mod_strings['LBL_CUSTOM_JOB'] = 'Custom Job';

Defining the Job Function

Next, we will define our custom job function using the extension framework.
./custom/Extension/modules/Schedulers/Ext/ScheduledTasks/<function_name>.php
In this example, my file will be named ‘custom_job.php’:
./custom/Extension/modules/Schedulers/Ext/ScheduledTasks/custom_job.php
This file will contain our new job function:
<?php
    array_push($job_strings, 'custom_job');
    function custom_job()
    {
        //logic here
            //return true for completed
            return true;
    }

Using the new Job

Once the files are in place, we will need to navigate to ‘Admin > Repair > Quick Repair and Rebuild’. This will rebuild the extension directories with our additions.
Next, navigate to Admin > Scheduler > Create Scheduler. In the Jobs dropdown, there will be a new custom job in the list.