Automating maintenance tasks

[Note]Note

This feature is only available in Admin Tools Professional, the for-a-fee edition of our software.

Admin Tools Professional allows you to automate site maintenance tasks using Joomla's Scheduled Tasks feature.

Preparing your site

By default, Joomla Scheduled Tasks will not run at all, ever. Something needs to periodically remind Joomla to check if there are any scheduled tasks to run and, if so, execute them. Joomla provides three triggering methods for its scheduled tasks:

  1. CLI CRON jobs. This is the most reliable triggering method. You set up one CRON job which runs every minute and tells Joomla to look for any pending tasks and execute them. This method is only suitable for hosts with real, CLI CRON jobs.

    You need to set up a CRON job to run the command

    /usr/bin/php /path/to/site/cli/joomla.php scheduler:run --all

    where /usr/bin/php is the full filesystem path to the PHP CLI executable and /path/to/site is the full filesystem path to your site. These items are host-specific. We are not your host, therefore we cannot possibly know what these are; please ask your host, that's what you are paying them for. Likewise for how to set up CRON jobs on your site's server.

    Important! This CRON job must be set up to run every minute of every hour of every day.

  2. “Web Cron” (URL-based CRON job). This is the second most reliable triggering method. You set up a CRON job which accesses a special URL on your site every minute and tells Joomla to look for any pending tasks and execute them. This method is suitable for hosts which only allow URL-based pseudo-CRON, i.e. accessing a URL periodically. We DO NOT recommend using this method with a third party service (such as webcron.org) because it gets very expensive, very fast. If your host does not support real or URL-based CRON jobs you are better off using the other automation methods mentioned earlier in this documentation.

    1. Go to your site's backend, System, Managed, Scheduled Tasks.

    2. Click on the Options button.

    3. Click on the Web Cron tab.

    4. Set the Web Cron option to Enabled.

    5. Click on the Save button on the toolbar.

    6. When the page reloads click on the Web Cron tab again.

    7. Copy the “Webcron Link (Base)” contents. It's a URL similar to https://www.example.com/component/ajax/?plugin=RunSchedulerWebcron&group=system&format=json&hash=f0oB4r.

    8. Create a CRON job to access this URL every minute of every hour of every day.

  3. Lazy Scheduling. This is the least reliable method. Your scheduled tasks are only executed when there is visitor traffic on your site. This means that your scheduled maintenance tasks may not be executed exactly when you have scheduled them to run or, in the case of low traffic or intermittent traffic sites with a large number of tasks, not at all.

    1. Go to your site's backend, System, Managed, Scheduled Tasks.

    2. Click on the Options button.

    3. Click on the Lazy Scheduler tab.

    4. Set the Lazy Scheduler option to Enabled.

    5. Click on the Save & Close button on the toolbar.

You are responsible for setting up one of these trigger methods on your site. Again, bear in mind that Joomla does not have any of these set up by default, meaning that no scheduled tasks will execute.

Unfortunately, we cannot provide any support for setting up the execution of Joomla Scheduled Tasks. It's your responsibility to ensure that Scheduled Tasks do work on your site and you need to understand the limitations of each method, especially Lazy Scheduling. As a result we cannot offer any support for scheduled tasks which have not started at all; start at the “wrong” time; take “too long” to finish; or do start but not finish at all without returning an error. This is all part of how Joomla operates.

Task types

The Task - Admin Tools plugin registers a number of task types for Joomla Scheduled Tasks. You will need to create new tasks and set them on a schedule of your choosing for one or more of these task types for scheduled maintenance tasks to be executed on your site.

You can create new scheduled tasks in your site's administrator backend by going to System, Maintenance, Scheduled Tasks and clicking on the New button in the toolbar.

Admin Tools' task types are described in the sections below.

Admin Tools – PHP File Change Scanner

This task type is used to scan your site for added and modified .php files, as well as assess their potential risk with the PHP File Change Scanner.

This task is documented separately since it conceptually belongs to the PHP File Change Scanner automation. You still need to have the Task - Admin Tools plugin installed and enabled for this task type to be available.