Scheduled tasks
Run a command on your site on a schedule, and check that it ran.
On this page
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can change its scheduled tasks.
- You know the command to run. It runs as
webfrom the site'shtdocsfolder.
Add a task
Open the site's scheduled tasks
Go to Managed Websites, choose the site, then Scheduled tasks under Site settings.
Name it, then set the schedule and command
Choose Add task and enter a Task name. Pick a Schedule, then enter the Command.
Add it and save
Choose Add task, then Save changes. Nothing on the site changes until you save.
The task is on the site within a minute or two. Its next run is under Last run.
Choices in the dialog
| Choice | What it does |
|---|---|
| Preset | Offers the common schedules, from Every minute to Monthly on day. |
| Custom | Takes a cron expression, such as 15 2 * * *. |
| Time limit | Stops a run that is still going after 15 minutes, 1 hour or 6 hours, and records it as timed out. |
| Skip if the previous run is still going | Stops two runs of the task overlapping. |
| Enabled | Untick to keep the task without running it. |
Times are London time.
Check a task ran
Read the Last run column
Last run shows when each task last ran, whether it succeeded and how long it took.
The first row is built in: it runs the platform's own cron, such as Magento cron or WordPress cron. It cannot be edited or removed.
Change, pause or remove a task
Use the task's row
Use the switch under On to pause a task or start it again. Open its … menu for Edit…, Duplicate and Remove.
Save
Choose Save changes.
The switch Scheduled tasks: On, at the top of the card, pauses every task at once.
Automate this
Replaces the whole set at the version you read.
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/crons \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"entries": [
{
"command": "curl -s -o /dev/null https://www.harbourandfinch.example.com/",
"enabled": true,
"label": "Warm the cache",
"no_overlap": true,
"schedule": "*/15 * * * *",
"timeout": 900
}
],
"version": 0
}'Your assistant calls corestack_crons_update.
{
"name": "corestack_crons_update",
"arguments": {
"site_id": 4211,
"version": 3,
"enabled": true,
"entries": [
{
"label": "Deploy key",
"schedule": "*/15 * * * *",
"command": "php -v",
"enabled": true,
"no_overlap": false,
"timeout": 900
}
]
}
}