Crontab doesn't work for me!

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

Moderators: Developers, Moderators

Post Reply
Guest

Crontab doesn't work for me!

Post by Guest »

Hi,

I am using RedHat 7.3 and if I put this line into crontab, nothing happend...
*/5 * * * * nobody php /home/htdocs/ssl/cacti/cmd.php > /dev/null 2>&1
But I solve the Problem and hope that I can help somebody else...

The solution is simple..
go to /etc/cron.d/
type vi cacticron
add the line of the quote (you should edit the user "nobody" and the path to the cmd.php)
save and exit...

Now your Graphs will refresh.

Your Tool is GREAT!!!!!! Thank you very much..

Yours sincerly,
Benjamin E.
Guest

Post by Guest »

Sorry for my english.. i am in hurry (and german :D)
guest

no files in rra and log dir

Post by guest »

its not creating any files on rra and log dir..
i changed its permission to <username> and put a line in my /etc/crontab

*/5 * * * * <username> php /var/www/html/cacti/cmd.php > /dev/null 2>&1
karlh
Posts: 37
Joined: Wed Mar 06, 2002 7:00 pm
Location: Reykjavik, Iceland
Contact:

RE: crontab not working

Post by karlh »

Hi.
You should really use this instead:

*/5 * * * * /usr/bin/php /var/www/html/load/cmd.php > /dev/null 2>&1

If you set up the cron as root and use a * instead of a user it will work.
Note: this is also on a RedHat server
Best regards
Karl Heidar
gilson
Posts: 27
Joined: Wed Jan 23, 2002 7:00 pm
Contact:

Post by gilson »

Only to clarify:

As said in documentation (http://www.raxnet.net/products/cacti/docs/INSTALL.htm, item 8 ), the syntax:
*/5 * * * * <username> /usr/bin/php /var/www/html/cacti/cmd.php > /dev/null 2>&1
applies to /etc/crontab ONLY.

If you login as Apache user (if it's possible) or "crontab -e -u apache" (edit crontab table for apache user) the syntax is almost the same as above, but WITHOUT <username>. The user's crontab ALREADY runs owned by the user itself.

-Gilson
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests