<div class="gmail_quote">On Thu, Mar 10, 2011 at 5:53 PM, Gregory Machin <span dir="ltr">&lt;<a href="mailto:gdm@linuxpro.co.za">gdm@linuxpro.co.za</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi.<br>
I have a script that needs to run from a cron job. I added the script<br>
as explained, in the deployment instructions.<br>
<br>
crontab -e (root) looks as follows<br>
<br>
* * * * *  /usr/bin/python /usr/bin/ZabbixApacheUpdater.py -c server1<br>
-z 10.24.0.231 &gt; /dev/null 2&gt;&amp;1<br>
* * * * *  /usr/bin/python /usr/bin/ZabbixApacheUpdater.py -c server2<br>
-z 10.24.0.231 &gt; /dev/null 2&gt;&amp;1<br>
<br></blockquote><div> </div><div>Try redirecting the output to a file (say, /var/log/zabbixdebug.log) instead of /dev/null.<br>The program may provide some clues about what is going wrong.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

But it&#39;s not doing anything.<br></blockquote><div><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
When I run the same syntax command from the command line it runs<br>
correctly every time.<br>
<br></blockquote><div><br>There may be something about your environment that is different from what cron sees, maybe some environmental variable that the script depends upon to find files, or that one of the servers needs.  With cron jobs you usually have to specify fully qualified paths for everything, maybe you script is not doing that, then not finding something it needs to do its work.<br>
 <br>The vast majority of the time when a cron job fails to work it is one of two things, the environment or permissions.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

I have tried changing the fill permissions and the syntax of the cron<br>
entries but nothing works.<br></blockquote><div><br>As a sanity check, make sure that what you have in the crontab file is still correct, copy it from the crontab file and paste it into a shell prompt to verify that you haven&#39;t made matters worse while trying to find the problem. <br>
</div></div><br><br>Mike<br><br>