Cron jobs for Mautic 4.1.0

MAUTIC 4.1.0

My PHP version is : 7.4.25

My MySQL/MariaDB version is:
10.3.31-MariaDB-0ubuntu0.20.04.1

Your problem
My problem is :
Campaigns are not sending mail sequence

Steps I have tried to fix the problem :
I tried to fix cron jobs, but can’t find any tutorial online to make a fix for Mautic 4.
Can anyone help me to fix cron jobs?

please paste your crondjobs here

Hey,
Here is the folder: /var/spool/cron/crontabs, file root.

and here are the cron jobs.

DO NOT EDIT THIS FILE - edit the master and reinstall.

(/tmp/crontab.Qt2maQ/crontab installed on Sat Dec 11 18:48:51 2021)

(Cron version – $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)

Edit this file to introduce tasks to be run by cron.

Each task to run has to be defined through a single line

indicating with different fields when the task will be run

and what command to run for the task

To define the time you can provide concrete values for

minute (m), hour (h), day of month (dom), month (mon),

and day of week (dow) or use ‘*’ in these fields (for ‘any’).

Notice that tasks will be started based on the cron’s system

daemon’s notion of time and timezones.

Output of the crontab jobs (including errors) is sent through

email to the user the crontab file belongs to (unless redirected).

For example, you can run a backup of all your user accounts

at 5 a.m every week with:

0 5 * * 1 tar -zcf /var/backups/home.tgz /home/

For more information see the manual pages of crontab(5) and cron(8)

m h dom mon dow command

          • php /var/www/html/bin/consol mautic:segments:update > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:webhooks:process > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:leadlists:update > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:campaigns:update > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:campaigns:trigger > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:social:monitoring > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:email:process > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:fetch:email > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:iplookup:download > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:campaigns:rebuild > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:broadcasts:send > /dev/null 2>&1
          • php /var/www/html/bin/console mautic:import > /dev/null 2>&1

Just realize this line is wrong and I fixed it:

          • php /var/www/html/bin/consol mautic:segments:update > /dev/null 2>&1

to:

          • php /var/www/html/bin/console mautic:segments:update > /dev/null 2>&1

Started the campaign again and
still not sending mails.

bin/console mautic:email:send
And
bin/console swiftmailer:email:send

Thank you!
Should I restart the server or restart anything else to make cron jobs run again?

Because I edited and after 24hrs, it’s still not working as before.

I was always surprised why people think it’s a good idea to run all the cronjobs at the same time.
Do you guys do that? And experience no issues?

I change it yesterday.
It looks like this now:

0,30 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:segments:update

*/3 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:import

5,20,35,50 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:campaigns:update

10,25,40,55 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:campaigns:trigger

10,25,40,55 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:messages:send

0,15,30,45 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:emails:send

0,17,38,46 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:email:fetch

0,30 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:social:monitoring

After edit it stop working. Any idea how to retrigger again?

Also I check status:

cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-01-27 10:05:24 CET; 5h 39min ago
Docs: man:cron(8)
Main PID: 374 (cron)
Tasks: 1 (limit: 9484)
Memory: 4.6M
CGroup: /system.slice/cron.service
└─374 /usr/sbin/cron -f

Jan 27 15:44:01 (SERVER NAME) CRON[8703]: pam_unix(cron:session): session closed for user root
Jan 27 15:44:01 (SERVER NAME) CRON[8704]: pam_unix(cron:session): session opened for user root by (uid=0)
Jan 27 15:44:01 (SERVER NAME) CRON[8702]: pam_unix(cron:session): session closed for user root
Jan 27 15:44:01 (SERVER NAME) CRON[8705]: pam_unix(cron:session): session opened for user root by (uid=0)
Jan 27 15:44:01 (SERVER NAME) CRON[8713]: (root) CMD (root /usr/bin/php /var/www/html/mautic/bin/console mautic:segments:update >/dev/null 2>&1)
Jan 27 15:44:01 (SERVER NAME) CRON[8716]: (root) CMD (root /usr/bin/php /var/www/html/mautic/bin/console mautic:campaigns:trigger >/dev/null 2>&1)
Jan 27 15:44:02 (SERVER NAME) CRON[8704]: pam_unix(cron:session): session closed for user root
Jan 27 15:44:02 (SERVER NAME) CRON[8708]: pam_unix(cron:session): session closed for user root
Jan 27 15:44:02 (SERVER NAME) CRON[8706]: pam_unix(cron:session): session closed for user root
Jan 27 15:44:02 (SERVER NAME) CRON[8705]: pam_unix(cron:session): session closed for user root
~

Please let me know if you can help me… thank you :slight_smile:

No, mine are staggered or I use the “&” symbol to run them in sequence.

1 Like

I am having a problem with my crons as well, and it’s not sending my email. I did try to post about it. Akismet marked my post as spam.

Any suggestions? I really need help with this. Thank you.

For the proper cronjob setup check this video:

You can also check this:

1 Like

Thank you so much. I really appreciate your help. I will go through both.

I did take down the old site and reinstalled it. Hopefully, this time I will get it right.