Mautic Community Forums

Cron Jobs Inquiry

Hi friends,

Yesterday, I finished the installation process of Mautic 2.12.1 on my VPS. Everything is OK. Now I have to create Cron Jobs but I realized that there are some differences between those cron jobs suggestions on the Internet. Check these suffixes:

path/to/php path/to/mautic/app/console mautic:segments:update
path/to/php path/to/mautic/app/console mautic:campaigns:rebuild
path/to/php path/to/mautic/app/console mautic:campaigns:trigger
path/to/php path/to/mautic/app/console mautic:emails:send
path/to/php path/to/mautic/app/console mautic:social:monitoring

php /home/admin/web/ mautic:email:fetch > /dev/null 2>&1
php /home/admin/web/ mautic:messages:send > /dev/null 2>&1
php /home/admin/web/ mautic:campaigns:trigger > /dev/null 2>&1
php /home/admin/web/ mautic:campaigns:rebuild > /dev/null 2>&1
php /home/admin/web/ mautic:segments:update > /dev/null 2>&1
php /home/admin/web/ mautic:webhooks:process > /dev/null 2>&1

php /path/to/mautic/app/console mautic:leadlists:update –env=prod
php /path/to/mautic/app/console mautic:campaigns:update –env=prod
php /path/to/mautic/app/console mautic:campaigns:trigger –env=prod
php /path/to/mautic/app/console mautic:email:process –env=prod

How can I know what I need to use? Are these suffixes important?

Thanks a lot!

Its depends on your server … how they are ready to configure cron jobs///

Hi, I’ve recently installed Mautic and have just registered on this site. Not entirely sure of the etiquette for posting, however, was/am having problems with CRON jobs as well and was wondering if it is ‘OK’ to post my problem on this post? Please excuse if not… I have used the following as the format for my CRON jobs

/opt/bitnami/php/bin/php -f /home/bitnami/htdocs/mymautic/app/console mautic:email:process –env=prod

When I run the CRON I get the following

Command “mautic:email:process” is not defined.

Did you mean one of these?

I get similar returns for the leadlists:update, campaigns:update and campaigns:trigger CRONs… is this the correct behaviour or is something misconfigured? I am installed on an Amazon Lightsail server with a Bitnami stack, PHP 7.0.27-1, Apache 2.4.25, MySQL 5.6.35 and Mautic 2.12.1

Any assistance you can give me gratefully accepted - and apologies if I have hijacked this post

Sorry bizcrony, I appear to be getting this totally wrong… could you give me a link to the default CRON jobs that need to be setup please? I noticed there are a number of different jobs in Salahs posting - I have managed to get some ‘good’ responses e.g.

segments:update completes successfully
campaigns:rebuild completes successfully
campaigns:trigger completes successfully
emails:send - ERROR Mautic is not set to queue email
social:monitoring - ERROR No published monitors found. Make sure the id you supplied is published

Thanks for your time and patience

Need to check

Here is the link >>

By the way…

> /dev/null 2>&1

These are not important “as I have been told”. It should store log only if you have any issues with Cron Jobs. If Cron Jobs work fine there is no need to have it.

Just in case you’re not sure about PHP path, you can type this command in SSH to know for sure where your PHP is locating:

which php

Actually, don’t know if this would help but it’s here in case someone care :slight_smile:

Thanks Salah and Bizcrony, greatly appreciated