Understanding Cron Jobs – A Mautic Minute
Do you have your Mautic forms, landing pages and campaign emails ready to go but nothing is happening? If you’re using the self-hosted version of Mautic, you need to check your CRON jobs.
Cron jobs are one of the most frequent topics in our Slack chats.
Cron is a time-based job scheduler in Unix-like computer operating systems. Cron schedules jobs (commands or shell scripts) to run at fixed times, dates, or intervals. Mautic requires cron jobs to update contacts, campaigns and execute campaign actions. Mautic also optionally uses cron jobs to send emails and perform other related tasks.
If you’re in the marketing department, that may sound like “greek” to you. In this Mautic Minute, we explain cron jobs and visually explain each part.
Mautic requires three cron jobs:
- Keeping segments current – php /path/to/mautic/app/console mautic:segments:update
- Keeping campaigns updated – php /path/to/mautic/app/console mautic:campaigns:update
- Trigger campaign events – php /path/to/mautic/app/console mautic:campaigns:trigger
These paths will change based on your web server and Mautic installation.
- if you’re not sure, ask your web host for the path to php .
- if you’re comfortable with the shell and have access, run this command: which php.
- to find the root of your website run: pwd – then add the Mautic directories after the response (see the image below).
There are several optional cron jobs, depending on your configuration. You can read the full documentation at https://mautic.org/docs/en/setup/cron_jobs.html. There are a few host-specific notes in the full documentation and it is worthwhile to completely read through.
Make sure you subscribe to our YouTube channel.