crontab - scripts not exiciting.

Mike Williams dmikewilliams at gmail.com
Fri Mar 11 00:14:57 UTC 2011


On Thu, Mar 10, 2011 at 5:53 PM, Gregory Machin <gdm at linuxpro.co.za> wrote:

> Hi.
> I have a script that needs to run from a cron job. I added the script
> as explained, in the deployment instructions.
>
> crontab -e (root) looks as follows
>
> * * * * *  /usr/bin/python /usr/bin/ZabbixApacheUpdater.py -c server1
> -z 10.24.0.231 > /dev/null 2>&1
> * * * * *  /usr/bin/python /usr/bin/ZabbixApacheUpdater.py -c server2
> -z 10.24.0.231 > /dev/null 2>&1
>
>
Try redirecting the output to a file (say, /var/log/zabbixdebug.log) instead
of /dev/null.
The program may provide some clues about what is going wrong.


> But it's not doing anything.
>

When I run the same syntax command from the command line it runs
> correctly every time.
>
>
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.

The vast majority of the time when a cron job fails to work it is one of two
things, the environment or permissions.

I have tried changing the fill permissions and the syntax of the cron
> entries but nothing works.
>

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't made matters worse while trying to find the problem.



Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20110310/a2d5c36c/attachment-0001.html 


More information about the users mailing list