Setting up Mautic cron jobs

Your software
My Mautic version is: 3.0.0
My PHP version is: 7.3.20

Your problem
My problem is: Setting up Mautic cron jobs

Hello!
I tried importing contacts in Mautic several times without any success. I was then told that I have to set some mandatory cron jobs (mautic:segments:update; mautic:campaigns:update; mautic:campaigns:trigger; etc). However, I am not used to work with command lines and control panels. The command syntax that I used is:
Path to PHP+“space”+path to Mautic+“space”+mautic:…

Is it the correct syntax?
If you have any suggestions or advice to setup Mautic correctly, please share them with me :slightly_smiling_face:

Do you have ssh access? or are you doing it via a control panel?

Hello @devsrealm and thank you for replying.

I am doing it via a control panel (cPanel).

Don’t really have experience with c-panel, but could you paste what you’ve done!

These are the cron jobs that I have already created:

0,15,30,45 * * * * /usr/local/bin/lsphp /home/noticeofintentto/public_html/mautic/bin/console mautic:segments:update --env=prod

5,20,35,50 * * * * /usr/local/bin/lsphp /home/noticeofintentto/public_html/mautic/bin/console mautic:campaigns:update --env=prod

10,25,40,55 * * * * /usr/local/bin/lsphp /home/noticeofintentto/public_html/mautic/bin/console mautic:campaigns:trigger --env=prod

* * * * * /usr/local/bin/lsphp /home/noticeofintentto/public_html/mautic/bin/console mautic:import --env=prod

looks okay, have you tested that it works?

Do you have shell (terminal) access? If not, you’re unlikely to be able to troublshoot this effectively. If you do have shell access:

  • What user are those cron jobs running under?

  • What’s the output of:

    • ls -l /usr/local/bin/lsphp
    • ls -l /home/noticeofintentto/public_html/mautic/bin/console
  • What happens if you run the cron jobs interactively?

The above cron jobs were actually working @devsrealm :sweat_smile:.
The problem was that when I set them up, I just reactivated the imports from the import history, so I suppose that those already created imports were not up to date with the server’s cron jobs.
Anyways, when I started a new browser import, it worked correctly.

Thank you very much @devsrealm and @backseat! :slightly_smiling_face:

2 Likes