From the GUI
On the Dashboard > System & Settings > Automation > Tasks page, you’ll see a list of all tasks installed in your site.
To run a task from this interface, first choose a task a by clicking on the radio button next to it. Here, let’s select “Reindex Content” to reindex all the pages in our site.
Once we select “Reindex Content”, any input variables that this task makes available are available beneath the task grid:
Using these options, we can determine whether we want to clear the index prior to re-indexing all the entries, whether we want to fully rebuild the underlying database table, reindex just a subset of pages, and which object type we want to reindex (pages).
Once we’re happy with the choices we’ve selected, we can click “Run Task” and the task will execute. This will redirect us to the Task Activity page:
The “Generate Sitemap” command is an asynchronous, non-batched task: that means it operates in the background, without tying up the user and making them wait – but it only executes a single command.
Here we have our “Generate Sitemap” task waiting in the task queue for our “Reindex Content” task to complete:
From the Command Line
Any task that’s installed can be executed from the Dashboard tasks interface, and from the command line. Here’s our list of tasks from the command line:
First, type concrete/bin/concrete
from within your site’s root directly on the command line. You should see a long list of commands available, with tasks toward the end:
This list of commands is dynamically generated from the tasks installed in the site. To get help for any of the commands you can add the --help
option while calling the command.
Typing concrete/bin/concrete task:reindex-content --help
yields:
See the boolean options for “clear”, “rebuild”, the numerical option for “after” and the required argument for “object”? The same options available for configuring a task in the GUI are also available in the command line. This is one of the major advantages to Tasks when compared to Jobs in previous versions of Concrete CMS.
Let’s reindex our site’s page content from the command line. Let’s also rebuild the index entirely, and clear it out to ensure it’s fully up to date.
concrete/bin/concrete task:reindex-content --clear --rebuild pages
GUI and Console Unification
In case it’s not clear from these examples, tasks are fully unified across the GUI and console. The same options available to the GUI are available in the console, by design. The same output that is shown on the console will also be placed in the task logs (more on this later.) Finally, the console and the GUI fully coexist and can work together.
For example, Let’s start a reindex content task from the GUI: