# Connect Cron Jobs external - Mautic 2.0

**URL:** <https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841>\
**Category:** Product Support\
**Created:** [July 12, 2016, 5:08am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841 "2016-07-12T05:08:19Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![clalihu](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@clalihu](https://forum.mautic.org/u/clalihu)\
**Post date:** [July 12, 2016, 5:08am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/1 "2016-07-12T05:08:19Z")

</div>

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/](https://cron-job.org/en/)  
  
How I can do?

---

<div class="post-metadata">

**Author:** ![clalihu](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@clalihu](https://forum.mautic.org/u/clalihu)\
**Post date:** [July 12, 2016, 5:08am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/2 "2016-07-12T05:08:19Z")

</div>

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/](https://cron-job.org/en/)  
How I can do?

---

<div class="post-metadata">

**Author:** ![HaydenR](https://avatars.discourse-cdn.com/v4/letter/h/2acd7d/32.png) [@HaydenR](https://forum.mautic.org/u/HaydenR)\
**Post date:** [July 12, 2016, 9:49am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/3 "2016-07-12T09:49:02Z")

</div>

Go here: [https://gist.github.com/escopecz/9a1a0b10861941a457f4](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](http://yourmautic.com)]/commands.php?ILoveMauticReallyIDo. Change[[yourmautic.com](http://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](https://www.mautic.org/community/index.php/4855-2-0-new-mautic-cli-commands/0#p12903)

---

<div class="post-metadata">

**Author:** ![joew](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@joew](https://forum.mautic.org/u/joew)\
**Post date:** [July 12, 2016, 2:28pm UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/4 "2016-07-12T14:28:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Agnon](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@Agnon](https://forum.mautic.org/u/Agnon)\
**Post date:** [July 18, 2016, 7:00am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/5 "2016-07-18T07:00:08Z")

</div>

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](http://easycron.com) should also work.

---

<div class="post-metadata">

**Author:** ![klausv1304](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@klausv1304](https://forum.mautic.org/u/klausv1304)\
**Post date:** [July 20, 2016, 2:23pm UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/6 "2016-07-20T14:23:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Paul999](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paul999/32/156_2.png) [@Paul999](https://forum.mautic.org/u/Paul999)\
**Post date:** [February 4, 2017, 8:24am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/7 "2017-02-04T08:24:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![abdel75](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@abdel75](https://forum.mautic.org/u/abdel75)\
**Post date:** [February 22, 2017, 11:30am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/8 "2017-02-22T11:30:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ninjoan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ninjoan/32/1005_2.png) [@ninjoan](https://forum.mautic.org/u/ninjoan)\
**Post date:** [February 22, 2017, 8:43pm UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/9 "2017-02-22T20:43:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![abdel75](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@abdel75](https://forum.mautic.org/u/abdel75)\
**Post date:** [February 23, 2017, 7:45am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/10 "2017-02-23T07:45:33Z")

</div>

@ninjoan

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

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

---

<div class="post-metadata">

**Author:** ![abdel75](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@abdel75](https://forum.mautic.org/u/abdel75)\
**Post date:** [February 23, 2017, 10:20am UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/11 "2017-02-23T10:20:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![autoize](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/autoize/32/105_2.png) [@autoize](https://forum.mautic.org/u/autoize)\
**Post date:** [February 23, 2017, 4:12pm UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/12 "2017-02-23T16:12:39Z")

</div>

The cron job for social monitoring is:

```auto
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/resources/cron-job-update-mautic-2-0/)  
[https://www.mautic.org/community/index.php/4855-2-0-new-mautic-cli-commands](https://www.mautic.org/community/index.php/4855-2-0-new-mautic-cli-commands)

---

<div class="post-metadata">

**Author:** ![abdel75](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@abdel75](https://forum.mautic.org/u/abdel75)\
**Post date:** [February 23, 2017, 5:53pm UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/13 "2017-02-23T17:53:08Z")

</div>

thanks @autoize

does that work for mautic 2.6.1?

---

<div class="post-metadata">

**Author:** ![abdel75](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@abdel75](https://forum.mautic.org/u/abdel75)\
**Post date:** [February 23, 2017, 5:57pm UTC](https://forum.mautic.org/t/connect-cron-jobs-external-mautic-2-0/3841/14 "2017-02-23T17:57:13Z")

</div>

@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?
