Page 1 of 1

i'm so confused with cron, please help...

Posted: Fri Jan 16, 2004 6:00 pm
by lizlazloz
ok, all i want to do is for cron to run a php page once an hour through CPanel.

but what do i put in the command to run box? i have searched and searched, but nothing works.... please help!

Posted: Sat Jan 17, 2004 11:02 am
by ilovetoast
PHP Cron tasks should be called via "wget" -

Syntax:

Code: Select all

wget http://www.domain.com/file.php -q -O /dev/null
Note:
That is a capital letter O not the number 0.

Explanation (as stated on their site):
GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without Xsupport, etc.

Switches:
Quiet Mode
-q tells wget to suppress its output

No Save - Causes the output of the wget to not be saved.
-O /dev/null means redirect output to /dev/null

Troubleshooting:
In order to run a cron job that parses the php, the php file needs to be in a web accessible directory. As long as you can the file URL in your web browser, you can use wget.

Reference:
http://www.gnu.org/software/wget/

peace