Crontab does't seems to work

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
peterg
Posts: 1
Joined: Fri Sep 05, 2003 2:17 am

Crontab does't seems to work

Post by peterg »

I'm a new in linux and stuf..............
My problem is, when I run cacti/cmd.php in my webbrowser, so the graphic updates. But when crontab updates it, nothing hapends.......
Fred
Cacti User
Posts: 81
Joined: Fri Jan 03, 2003 11:43 am

Some diagnostics

Post by Fred »

Remove the redirection from the crontab entry. That is, cut out the "> /dev/null 2>&1", and then check root's email after 5 minutes. You'll get to see any error messages that may have been generated.
pbulteel
Cacti User
Posts: 150
Joined: Fri Sep 05, 2003 9:20 am
Location: London
Contact:

Check your path.

Post by pbulteel »

Chances are that your crontab isn't including the path correctly to the CLI php. Try changing the crontab entry to include the path to php. Type which php at your command line and use that as the result.

e.g. which php
/usr/bin/php

crontab now reads /usr/bin/php /cacti/cmd.php > /dev/null ... etc.
uname -a
peterga

dosn't work

Post by peterga »

When I deleted "> /dev/null......", I get this message from webmin when I run the crontab (this is the same message when I run cmd.php in linux):

Output from command /usr/bin/php4 /usr/share/cacti/cmd.php ..

Content-type: text/html

PHP Warning: mysql: Unable to initialize module
Module compiled with debug=0, thread-safety=0 module API=20020429
PHP compiled with debug=0, thread-safety=0 module API=20010901
These options need to match
in Unknown on line 0
PHP Warning: gd: Unable to initialize module
Module compiled with debug=0, thread-safety=0 module API=20020429
PHP compiled with debug=0, thread-safety=0 module API=20010901
These options need to match
in Unknown on line 0
X-Powered-By: PHP/4.1.2
Content-type: text/html

<br />
<b>Fatal error</b>: Call to undefined function: mysql_connect() in <b>/usr/share/cacti/include/database.php</b> on line <b>19</b><br />
pbulteel
Cacti User
Posts: 150
Joined: Fri Sep 05, 2003 9:20 am
Location: London
Contact:

Looks like you haven't configured it correctly.

Post by pbulteel »

I have a feeling that the config.php file doesn't have the correct username and/or password for the database and I'm not sure if anything else is missing.
uname -a
Xtof

Re: Looks like you haven't configured it correctly.

Post by Xtof »

I think you don't have de mysql extension enable in you php.ini...
Add a line in you php.ini such as :
extension=mysql.so
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests