# Cron jobs are not triggering automatically

**URL:** <https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [March 26, 2022, 1:36pm UTC](https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319 "2022-03-26T13:36:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![designedbyks](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/designedbyks/32/6742_2.png) [@designedbyks](https://forum.mautic.org/u/designedbyks)\
**Post date:** [March 26, 2022, 1:36pm UTC](https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319/1 "2022-03-26T13:36:28Z")

</div>

**Your software**  
_My PHP version is 7.4.21_ :  
_My MySQL/MariaDB version is_ (delete as applicable): MySQL/MariaDB version:5.7.34

_My problem is_ :I am first time using mautic.I have setup everything correctly and everything is working perfect.But i am facing issues with cron jobs.Cron jobs are not getting triggered automatically.

_Steps I have tried to fix the problem_ :  
1.Clear Cache  
2.Cache warmup  
3.Check file permissions  
4.Run Cronjobs on command line,all are working.But not able to triggered automatically from crontab.

---

<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:** [March 28, 2022, 10:03am UTC](https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319/2 "2022-03-28T10:03:00Z")

</div>

Hi, can you share your settings, maybe we can spot an error.

---

<div class="post-metadata">

**Author:** ![ankushanand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ankushanand/32/8565_2.png) [@ankushanand](https://forum.mautic.org/u/ankushanand)\
**Post date:** [March 1, 2023, 6:39am UTC](https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319/3 "2023-03-01T06:39:26Z")

</div>

Hey @joeyk, I am also facing same issue on A2Hosting Server.

> 1,16,31,46 \* \* \* \* php /home/dyathink/crm.dyathink.com/bin/console mautic:segments:update --batch-limit=900 --env=prod  
> 5,20,35,50 \* \* \* \* php /home/dyathink/crm.dyathink.com/bin/console mautic:campaigns:update --env=prod  
> 10,25,40,55 \* \* \* \* php /home/dyathink/crm.dyathink.com/bin/console mautic:campaigns:trigger --batch-limit=100 --env=prod  
> \*/5 \* \* \* \* php /home/dyathink/crm.dyathink.com/bin/console mautic:email:fetch --env=prod  
> 13,28,43,58 \* \* \* \* php /home/dyathink/crm.dyathink.com/bin/console mautic:emails:send --env=prod

Here are my cronjob settings. If I run them manually, It all works fine. but automatically its not running or better word will be working. as Hosting Support replied that cronjobs are running as scheduled.

Looking forward for guidance on this

---

<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:** [March 1, 2023, 6:50am UTC](https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319/4 "2023-03-01T06:50:34Z")

</div>

Hello!  
You are running cron every 15 min (which is a good practice if you have limited resources)  
What do tou mean by not working? Are segments not updated?

---

<div class="post-metadata">

**Author:** ![ankushanand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ankushanand/32/8565_2.png) [@ankushanand](https://forum.mautic.org/u/ankushanand)\
**Post date:** [March 2, 2023, 7:24am UTC](https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319/6 "2023-03-02T07:24:58Z")

</div>

I fixed this issue @joeyk @designedbyks by adding

php directory instead of just php in cron job command.

> 1,16,31,46 \* \* \* \* **/usr/local/bin/php** /home/userdirectory/domain.com/bin/console mautic:segments:update --batch-limit=900 --env=prod \> /dev/null 2\>&1  
> 5,20,35,50 \* \* \* \* **/usr/local/bin/php** /home/userdirectory/crm.dyathink.com/bin/console mautic:campaigns:update --env=prod \> /dev/null 2\>&1  
> 10,25,40,55 \* \* \* \* **/usr/local/bin/php** /home/userdirectory/domain.com/bin/console mautic:campaigns:trigger --batch-limit=100 --env=prod \> /dev/null 2\>&1  
> \*/15 \* \* \* \* **/usr/local/bin/php** /home/userdirectory/domain.com/bin/console mautic:email:fetch --env=prod \> /dev/null 2\>&1  
> 13,28,43,58 \* \* \* \* **/usr/local/bin/php** /home/userdirectory/domain.com/bin/console mautic:emails:send --env=prod \>/dev/null 2\>&1

This fixed the issue for me, Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [March 3, 2023, 7:25pm UTC](https://forum.mautic.org/t/cron-jobs-are-not-triggering-automatically/23319/7 "2023-03-03T19:25:03Z")

</div>

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