Re: crontab - scripts not exiciting.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 10, 2011 at 5:53 PM, Gregory Machin <gdm@xxxxxxxxxxxxxx> 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

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux