Scheduled and adhoc tasks
Scheduled tasks run on a crontab-like schedule, which is configured at Site administration > Server > Scheduled tasks.
Run all pending scheduled and adhoc tasks using server/admin/cli/cron.php. F
or production sites, it is recommended to run this script as the webserver user once per minute.
In docker-dev, use the cron shortcut inside the tphp container to execute all pending tasks on demand.
Normally a task won’t run more than once per minute, but you can mark some or all tasks as pending for the next cron run, via the Scheduled tasks settings page.
Execute just one scheduled task
To execute a specific scheduled task, you need to know its classname. With that, you can run the schedule_task.php (sic) CLI script:
php server/admin/tool/task/cli/schedule_task.php --execute=\\tool_usagedata\\task\\export_taskThere are other useful debugging options:
$ php server/admin/tool/task/cli/schedule_task.php --help ✔
Run scheduled cron tasks.
Options:
--execute=\\some\\task Execute scheduled task manually
--list List all scheduled tasks
--showsql Show sql queries before they are executed
--showdebugging Show developer level debugging information
-h, --help Print out this helpList or execute specific adhoc tasks
There is a similar script for adhoc tasks, adhoc_task.php:
$ php server/admin/tool/task/cli/adhoc_task.php --help ✔
Run queued adhoc cron tasks.
Options:
-e --execute=classname Run all the given instances of a adhoc class, or 'all' / '*' to run all existing queued adhoc tasks
-l --list List all queued adhoc tasks
--showsql Show sql queries before they are executed
--showdebugging Show developer level debugging information
-h, --help Print out this help