# Cron jobs for Mautic 4.1.0

**URL:** <https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [December 13, 2021, 2:21pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995 "2021-12-13T14:21:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mido/32/6751_2.png) [@mido](https://forum.mautic.org/u/mido)\
**Post date:** [December 13, 2021, 2:21pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/1 "2021-12-13T14:21:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [December 13, 2021, 4:29pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/2 "2021-12-13T16:29:03Z")

</div>

please paste your crondjobs here

---

<div class="post-metadata">

**Author:** ![mido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mido/32/6751_2.png) [@mido](https://forum.mautic.org/u/mido)\
**Post date:** [December 13, 2021, 4:31pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/3 "2021-12-13T16:31:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mido/32/6751_2.png) [@mido](https://forum.mautic.org/u/mido)\
**Post date:** [December 13, 2021, 4:53pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/4 "2021-12-13T16:53:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [December 14, 2021, 3:15pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/5 "2021-12-14T15:15:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mido/32/6751_2.png) [@mido](https://forum.mautic.org/u/mido)\
**Post date:** [January 27, 2022, 12:16pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/6 "2022-01-27T12:16:54Z")

</div>

> [@EJL](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 27, 2022, 1:48pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/7 "2022-01-27T13:48:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mido/32/6751_2.png) [@mido](https://forum.mautic.org/u/mido)\
**Post date:** [January 27, 2022, 2:45pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/8 "2022-01-27T14:45:09Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [January 27, 2022, 10:36pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/9 "2022-01-27T22:36:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jjarrett](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jjarrett/32/6763_2.png) [@jjarrett](https://forum.mautic.org/u/jjarrett)\
**Post date:** [January 29, 2022, 4:37pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/10 "2022-01-29T16:37:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 30, 2022, 11:01am UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/11 "2022-01-30T11:01:51Z")

</div>

For the proper cronjob setup check this video:

[![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/97e2e776c3a3881b387dcfc0c7809b2d55e67d45.jpeg "Mautic Cron Jobs - MMLagos October 2020") ](https://www.youtube.com/watch?v=bQ9WrgWNLVQ)

You can also check this:

> **[This new app figures out your cronjobs – Joey Keller](https://joeykeller.com/this-new-app-figures-out-your-cronjobs/)**

---

<div class="post-metadata">

**Author:** ![jjarrett](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jjarrett/32/6763_2.png) [@jjarrett](https://forum.mautic.org/u/jjarrett)\
**Post date:** [January 30, 2022, 1:02pm UTC](https://forum.mautic.org/t/cron-jobs-for-mautic-4-1-0/21995/12 "2022-01-30T13:02:20Z")

</div>

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.
