Zum Inhalt springen

Scheduler: Automate tasks in TYPO3

The scheduler extension supplied with TYPO3 enables the regular execution of tasks in TYPO3, for example:

  • Updating statistics
  • Newsletter dispatch
  • Reindexing for the search function
  • Cleaning up the database

Previously, you could set up a separate cronjob for each of these tasks. In the scheduler, the tasks can be entered in a schedule and only one cronjob is required to call up the scheduler.

Set up cronjob

In the directory typo3cms/projekt1/typo3conf in our hosting packages, the file scheduler.sh is currently located with the following content:

#! /bin/bash
env -i /usr/local/bin/php7-72LATEST-CLI -f $PWD/typo3cms/projekt1/typo3/sysext/core/bin/typo3 scheduler:run

Depending on the PHP version used for the domain, the same PHP basic version should also be set here. Change the line for PHP version 7.3 as follows

env -i /usr/bin/php73 -f $PWD/typo3cms/ ...etc

The following PHP CLI versions are available:

/usr/bin/php56

/usr/bin/php70

/usr/bin/php71

/usr/bin/php72

/usr/bin/php73

/usr/bin/php74

/usr/bin/php80

/usr/bin/php81

/usr/bin/php82

/usr/bin/php83

 

If the TYPO3 project is located in a different directory, the path name within the file must be adjusted.

Now the script must be made executable:

chmod +x scheduler.sh

A cronjob is now set up in the customer menu to call this script every 30 minutes.

Updated: 18.07.2024