Scheduled Tasks

You can create an external task to be called with HTTP periodically or configure an existing one by going to Settings » System Scheduler. The system scheduler in SCHLIX CMS iwas created to mimic  the cron daemon that is present in most Unix-based system to run background tasks, such as regenerating XML sitemap for search engine, sending emails periodically, and so on. Everytime a user visits your site, the scheduler would also run to execute the tasks. If you have a medium to high website, it is recommended that you use the manual scheduler option from the configuration, and add the scheduled tasks to execute every minute from your operating system's CRON. You can also further restrict the IP address that can call this methods to prevent a denial of service.

 SCHLIX CMS Cron Configuration/>

For example: if you have CPanel, you can configure CPanel's CRON to call SCHLIX CMS' System scheduler to call this URL every minute:

curl https://www.your-website.com/cronscheduler/ > /dev/null

CRON operating system

 

To programmatically create a scheduled task in your application plugin (typically inside the constructor), use the method createDefaultSchedulerForMyApplicationStaticMethod from cronScheduler. Please note that your public static method must contain no parameter and it has to have the word "run" in it (e.g. processRunRegenerateSitemap(). For example:

$system_cron = new \App\Core_CronScheduler();
$system_cron->createDefaultSchedulerForMyApplicationStaticMethod('Regenerate schema.org sitemap', 'simple_sitemap::processRunRegenerateSitemap', "0 0 * * *");

Explanation:

createDefaultSchedulerForMyApplicationStaticMethod ("description","the public static method in your class that runs it periodically","cron string");

When you do this, it guarantees that even though the user accidentally deletes it, it will be recreated so it does not interrupt your website function.

CRON entries