Most websites have certain tasks that must be performed on a regular schedule, such as checking for inactive users, sending email notifications, reindexing the search engine or refreshing the sitemap.xml file. In Concrete this accomplished through the running of Tasks. Tasks can be run from the Concrete Dashboard or from the command line on your web server.
Version 8 and Below
Note: If version 9 is the first version of Concrete CMS you’ve ever used, you can skip on to the next section. However, if you’re familiar with older versions of Concrete, you may be asking how Tasks are similar to or different than Jobs, which have fulfilled this same purpose in Concrete since the very first version.
It’s true – Tasks and Jobs fulfill the same purpose. In Concrete version 9 all Jobs that ship with the core have been rewritten as Tasks. Jobs do remain, however, in case you have custom Jobs installed in your site, or installed by packages that your site relies on. Tasks offer a number of improvements over jobs, which is why they’re the much preferred method of offering this kind of functionality going forward.
- Tasks offer better feedback when run in the Dashboard.
- Tasks can accept user input (both from the Dashboard and the command line.)
- Tasks can be scheduled using standard cron syntax.
- Tasks can actually trigger output when run from the command line. This same output can also be shown real-time in the Dashboard, and logged to persistent logs.
- The syntax for defining the programming logic behind Tasks is more in line with modern programming principles.
- Tasks can be easily written to be run synchronously, asynchronously, or even in asynchronous batches.
- Tasks can be coupled with headless task workers, making the logic of running tasks much more performant and less likely to cause timeouts and premature halts.