Mautic Community Forums

Connect Cron Jobs external - Mautic 2.0

Hello, mi name is Claudia.

I am new in Mautic. The installation of mautic is ok, but the Cron jobs are a problem for me.

I hope you can will share their experience in installation Mautic 2.0



I want connect the Cron Jobs with https://cron-job.org/en/

How I can do?

Hello, mi name is Claudia.
I am new in Mautic. The installation of mautic is ok, but the Cron jobs are a problem for me.
I hope you can will share their experience in installation Mautic 2.0

I want connect the Cron Jobs with https://cron-job.org/en/
How I can do?

Go here: https://gist.github.com/escopecz/9a1a0b10861941a457f4 copy the file. on your server create a file called cronjob.php and paste contents. If you are on V2.O replace the commands with the new cron cli commands.

How to make it work

Create a PHP file in the root folder of Mautic.
Copy and paste the code of the script above.
Change ILoveMauticReallyIDo in that script to some secret phrase so only you’ll be able to run the commands.
Run a command by accessing this URL with your browser http://[yourmautic.com]/commands.php?ILoveMauticReallyIDo. Change[yourmautic.com] to your domain or wherever your Mautic runs and ILoveMauticReallyIDo to your secret phrase form 3.
How to use it

When you execute the URL form 4., you should get the list of available commands with URL addresses. You can try to click on those to run the command manually or insert those URL addresses to a cron UI provided by your web hosting company.

In easy cron add the url and set the time you wish. Remember the command in the sript above are for 1.4.1
read this: https://www.mautic.org/community/index.php/4855-2-0-new-mautic-cli-commands/0#p12903

I need to know also, I used the suggested script. Does any know why I get an error for all of the urls when I clicking/ executing?

Fatal error: Class ‘SymfonyComponentConsoleInputArgvInput’ not found in /home/****/public_html/app1/commands.php on line 62

Thanks for HaydenR the great post. It helps me understand how to set the cron job work on Mautic.
As for the cron job setting, instead of using hosting’s Cron, webcron like easycron.com should also work.

I tried to adapt the commands php on the new cron jobs in mautic 2.0 but I can`t get my campaign start to send emails
Has anyone a version that works with mautic 2.01 and the new commands
Would be great and I would be grateful

Klaus

The script has just been updated to work with Mautic 2.5. I just set it up. it works :smiley: Finally got my crons setup now thanks to this. Thanks everyone.

Script generated something for me, I did get the web page with all the links, when I click in one link, for example, leads update I get a blank page with:
“Executing console mautic:leadlists:update”
any info of where should we see the evolution or logs of those script to know that they went well?
Appart from this simple message, where do we see that it worked concretely?
thanks for your contribution, I’m only starting with this

@abdel75 check this script
https://www.mautic.org/community/index.php/5092-mautic-2-0-up-cronjob-update-2-5-x

@ninjoan

thanks for your reply, I updated my posts in github, but not yet here :slight_smile:

I found the mistake, it works now on easycron, jobs succeed

when in a post in github (and probably here) it said: “When you execute the URL form 4., you should get the list of available commands with URL addresses. You can try to click on those to run the command manually or insert those URL addresses to a cron UI provided by your web hosting company”

Actually, there is a clarification to be done: The links for crons shown after they are generated from initial link with secret phrase, they can be copied, but we should remove the secret phrase that is still in the url link, then, it works, at least it worked this way for me

regarding cron jobs, if someone can confirm me the line code we can add in the script for Social Monitoring update that would help :wink:
thanks

The cron job for social monitoring is:

php /path/to/mautic/app/console mautic:social:monitoring

For future reference you can refer to the following lists published by Mautic:
https://www.mautic.org/resources/cron-job-update-mautic-2-0/
https://www.mautic.org/community/index.php/4855-2-0-new-mautic-cli-commands

thanks @autoize

does that work for mautic 2.6.1?

@ninjoan

does the script you sent a link for works for mautic 2.6.1?

Got something weird on easycron, it shows the cron as succeed, but the logs in the cron shows this (secret phrase is wrong):

Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
Set-Cookie: SERVERID585=2020199|WK8f/|WK8f/; path=/
Cache-Control: private
Date: Thu, 23 Feb 2017 17:46:35 GMT
Server: Apache
X-Powered-By: PHP/5.6.21

The secret phrase is wrong.

Means that status is under succeed but in fact, nothing occurs right?