# Cron to update Leads and Segments

**URL:** <https://forum.mautic.org/t/cron-to-update-leads-and-segments/4288>\
**Category:** General Discussion\
**Created:** [June 20, 2016, 9:06pm UTC](https://forum.mautic.org/t/cron-to-update-leads-and-segments/4288 "2016-06-20T21:06:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![herek](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@herek](https://forum.mautic.org/u/herek)\
**Post date:** [June 20, 2016, 9:06pm UTC](https://forum.mautic.org/t/cron-to-update-leads-and-segments/4288/1 "2016-06-20T21:06:03Z")

</div>

Hello,  
  
  
  
I am facing a problem. I have a huge list already imported, however, the contacts are not in the correct segment. I have create a new one and used the filter to add the contacts to the new segment (I want all of them), however it didn’t worked.  
  
  
  
Then I noticed that the cron job was not working as it should. I am using Plesk and I have created the cron job like this:  
  
  
  
httpdocs/emm/app/console mautic:email:process --env=prod  
  
  
  
This worked to send emails when I did a campaign test.  
  
the result for the logs is:  
  
  
  
“Task “httpdocs/emm/app/console” successfully completed in 0 seconds, output:  
  
Mautic is not set to queue email.”  
  
  
  
However, the other crons return an error:  
  
  
  
  
  
httpdocs/emm/app/console mautic:campaigns:update --env=prod  
  
  
  
Task “httpdocs/emm/app/console” completed with error in 61 seconds, output:  
  
  
  
-: /usr/bin/php5: No such file or directory  
  
  
  
  
  
httpdocs/emm/app/console mautic:leadlists:update --env=prod  
  
Task “httpdocs/emm/app/console” completed with error in 61 seconds, output:  
  
  
  
-: /usr/bin/php5: No such file or directory  
  
  
  
  
  
So, I believe my segments are not being updated because the problem in cron.  
  
  
  
  
  
What I am missing?  
  
  
  
Thank you  
  
  
  
Sandro Herek

---

<div class="post-metadata">

**Author:** ![herek](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@herek](https://forum.mautic.org/u/herek)\
**Post date:** [June 20, 2016, 9:06pm UTC](https://forum.mautic.org/t/cron-to-update-leads-and-segments/4288/2 "2016-06-20T21:06:03Z")

</div>

Hello,

I am facing a problem. I have a huge list already imported, however, the contacts are not in the correct segment. I have create a new one and used the filter to add the contacts to the new segment (I want all of them), however it didn’t worked.

Then I noticed that the cron job was not working as it should. I am using Plesk and I have created the cron job like this:

httpdocs/emm/app/console mautic:email:process --env=prod

This worked to send emails when I did a campaign test.  
the result for the logs is:

“Task “httpdocs/emm/app/console” successfully completed in 0 seconds, output:  
Mautic is not set to queue email.”

However, the other crons return an error:

httpdocs/emm/app/console mautic:campaigns:update --env=prod

Task “httpdocs/emm/app/console” completed with error in 61 seconds, output:

-: /usr/bin/php5: No such file or directory

httpdocs/emm/app/console mautic:leadlists:update --env=prod  
Task “httpdocs/emm/app/console” completed with error in 61 seconds, output:

-: /usr/bin/php5: No such file or directory

So, I believe my segments are not being updated because the problem in cron.

What I am missing?

Thank you

Sandro Herek
