Whyyyy, the graphs don't work with crontab?

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

Moderators: Developers, Moderators

Post Reply
cerberof

Whyyyy, the graphs don't work with crontab?

Post by cerberof »

hi, i have a problem very extrange. when I run /usr/bin/php /var/www/html/cacti/cmd.php manually, i see the graphs from web.
but when i charge */5 * * * * apache /usr/bin/php /var/www/html/cacti/cmd.php > /dev/null 2>
&1 at the crontab, It ' doesn't work. why?
I have the permissions in this way chown -R apache:apache /var/www/html/cacti/ and the same in /var/cacti
drwxrwxr-x 8 apache apache 4096 Sep 5 15:23 cacti

thanks. sorry about my english.
bocasman
Posts: 24
Joined: Mon Aug 19, 2002 8:27 am
Location: Panama
Contact:

Post by bocasman »

Hi,

You said that when you've ran manualy the /usr/bin/php /var/www/html/cacti/cmd.php manually it works good, let me ask you something, you are executing that command as "apache"?

Also, you have to make sure that apache can run /usr/bin/php.
Regards,
BM
James Austin
Posts: 5
Joined: Thu Sep 26, 2002 12:37 pm

Post by James Austin »

I had the same problem. Drove me nuts.

I fixed it by changing the line in crontab to the following:

*/5 * * * * apache cd <your path to>/cacti; php ./cmd.php > /dev/null 2>&1

Apparently crontab is sensitive about not being in the right directory when running cmd.php.

Hope this helps worked for me.
wiCKid

Worked for me!

Post by wiCKid »

Thanks! Same thing was happening to me. I just could not get Cron to run cmd.php. Great tip.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests