...

View Full Version : cronjob problem



graziano
03-06-2007, 04:53 PM
Hello

when I execute a php script using a cronjob in this way

*/5 * * * * /usr/bin/php /usr/local/script/myscript.php

It works without problem and execute each minutes

If I use

*/5 * * * * /usr/bin/php /usr/local/script/myscript.php > /dev/null

it does NOT work ..

Why ?

Inigoesdr
03-06-2007, 05:11 PM
/dev/null

graziano
03-06-2007, 05:24 PM
/dev/null

It was a typo it's already /dev/null :(

Inigoesdr
03-06-2007, 05:33 PM
Check your paths, check permissions, try to run the command from the console minus the "> /dev/null" and see if it gives you an error.

graziano
03-08-2007, 01:06 PM
The script from command line works without any problem.

> /dev/null works fine for all other cronjobs .

I'm going mad , which could be the problem ?

Thanks

sir pannels
03-08-2007, 01:57 PM
cron wont like the > as an output direction, you don't need it anyway ...


*/5 * * * * php /usr/local/script/myscript.php /dev/null

That will output the result to /dev/null

good luck

_Aerospace_Eng_
03-08-2007, 06:16 PM
In CPanel the default path is already
/usr/bin/ so you just need to complete it and doing what sir_panels says should work.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum