Mautic cron jobs on cPanel

Your software
My Mautic version is: v4.4.9
My PHP version is: 8.0.30
My Database type and version is: 10.6.15-MariaDB-cll-lve

Your problem
My problem is:
My segmenst are not updating and i believe this has to do with my cron jobs.
I have looked in several places but no campaign steps trigger and i cant remove people from campaigns. I’m also getting a 500 error when trying to remove people from campaigns.
This is the first time i am using mautic and i have never programmed cron jobs before

These errors are showing in the log:
I dont know where to find these logs

Steps I have tried to fix the problem:
I have changed the cron job lines several times but without success

Captura de Tela 2023-09-20 às 11.12.24

Kaige,

I have the same issue with Cron Jobs running on my cPanel installation of Mautic. I’ve opened a support ticket with cPanel. I’ll keep you updated.

Regards,
Hal

1 Like

Check, what is the output of the command when you run it via terminal directly. Also check the logs under /var/logs.

How can i do that if i use a hosting service, I could not find a command prompt app inside cPanel;

You should have access to some kind of terminal or enable ssh access.

If you want, I can try to do that for you (drop me a PM if interested).

Regards, M.

1 Like

I messaged my hosting service requesting access to the tool, will update this post as soon as I can test my cron jobs :^)

Welcome to Mautic,

It can be a little frustrating at first, but one all set up Mautic works very ell.

Cron job are critical and it seems the issue u are having are simply fixed by getting the cron jobs configured correctly. Your host will be be able to assist with you that. It’s straight fwd for someone with the required skills.

The correct cron includes the path to where you root mautic folder lives and then into the folder bin and then console, for eg

/www/mautic/bin/console

The exact path depends on how the file structure on your server. In the console folder run these commands

mautic:campaigns:update
mautic:campaigns:trigger
mautic:emails:send
mautic:import
mautic:email:fetch
mautic:iplookup:download

Here is a good staggered time interval to run the cron jobs. The numbers and * are what tell the server when to run the crons.

# update segments every 15 minutes
* * * * * 

# update campaigns every 15 minutes starting with an offset of 5 minutes at the beginning of each hour
5-59/15 * * * * 

# execute campaigns events every 15 minutes with an offset of 10 minutes
10-59/15 * * * * 

# process email queue
2-59/15 * * * * 

# import list in the background
* * * * * 

# Fetch bounce messages
@hourly 

# update MaxMind GeoLite2 IP Database once a week
@weekly 

Getting a 500 error when manually removing people from segments would be unrelated to cron issues.

You can check your logs by using the file manager in your C panel. Look for the mautic folder, you may have to hunt around a bit. Once found look for a folder call var, then a folder calledlogs.

In there you will see all the logs for mautic.

1 Like

“Most” time a failing cron job is because it doesn’t have enough memory. You may have allocated enough memory to the install directory, but cron runs on the root directory. Make sure in WHM the “server” is running the appropriate PHP version with at least 768MB of memory.

Our hosting service has not given me access to the console yet, but I am following your answers and I appreciate the help :^) They also have not touched our cron jobs, but as soon as I figure it out I will update this post. Thanks guys :blush:

I told them about the memory thing, and suddenly, without a single change to my cron paths, they work!
The ones that worked for me were
/usr/local/cpanel/3rdparty/bin/php for php and
/home/user/public_html/mautic/bin/console

Couldn’t have done it without you guys! :^)

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.