# How can we monitor cron tasks

**URL:** <https://forum.mautic.org/t/how-can-we-monitor-cron-tasks/8281>\
**Category:** General Discussion\
**Created:** [April 23, 2017, 7:32am UTC](https://forum.mautic.org/t/how-can-we-monitor-cron-tasks/8281 "2017-04-23T07:32:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurentm](https://avatars.discourse-cdn.com/v4/letter/l/c4cdca/32.png) [@laurentm](https://forum.mautic.org/u/laurentm)\
**Post date:** [April 23, 2017, 7:32am UTC](https://forum.mautic.org/t/how-can-we-monitor-cron-tasks/8281/1 "2017-04-23T07:32:18Z")

</div>

I am trying to get some contact to be moved to segments using cron task but it seems it doesn’t work.  
  
I use this : php-cli /home6/username/public\_html/mautic/app/console mautic:segments:update --env=prod \> /dev/null  
  
but it doesn’t seems to move the contact to the segmant.  
  
How can I check if the cron task is running the task properly ?  
  
We are on shared server bluehost.

---

<div class="post-metadata">

**Author:** ![laurentm](https://avatars.discourse-cdn.com/v4/letter/l/c4cdca/32.png) [@laurentm](https://forum.mautic.org/u/laurentm)\
**Post date:** [April 23, 2017, 7:32am UTC](https://forum.mautic.org/t/how-can-we-monitor-cron-tasks/8281/2 "2017-04-23T07:32:18Z")

</div>

I am trying to get some contact to be moved to segments using cron task but it seems it doesn’t work.  
I use this : php-cli /home6/username/public\_html/mautic/app/console mautic:segments:update --env=prod \> /dev/null  
but it doesn’t seems to move the contact to the segmant.  
How can I check if the cron task is running the task properly ?  
We are on shared server bluehost.

---

<div class="post-metadata">

**Author:** ![JoPitts](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jopitts/32/636_2.png) [@JoPitts](https://forum.mautic.org/u/JoPitts)\
**Post date:** [April 23, 2017, 7:22pm UTC](https://forum.mautic.org/t/how-can-we-monitor-cron-tasks/8281/3 "2017-04-23T19:22:58Z")

</div>

Why not write your output to a file rather than to dev/null and see what the output of your job is?

If you are getting error states in there you may need to write both stdout and stderr to a file. Examples of how to do this are [here](https://www.cyberciti.biz/faq/redirecting-stderr-to-stdout/)

---

<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:** [May 10, 2017, 7:47am UTC](https://forum.mautic.org/t/how-can-we-monitor-cron-tasks/8281/4 "2017-05-10T07:47:12Z")

</div>

Maybe you can use a webcron service called [easycron.com](http://easycron.com) to trigger the script to run, it very easy to set up and supports multiple configurations.

---

<div class="post-metadata">

**Author:** ![redneckbob](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@redneckbob](https://forum.mautic.org/u/redneckbob)\
**Post date:** [May 17, 2017, 7:24am UTC](https://forum.mautic.org/t/how-can-we-monitor-cron-tasks/8281/5 "2017-05-17T07:24:28Z")

</div>

On Ubuntu I send my crond output to /tmp, so my cron command looks like this:

sudo -u www-data /usr/bin/php /var/www/html/app/console mautic:social:monitoring 2\>&1 \>\> /tmp/mautic.social.monitoring.txt
