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

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
lizlazloz
Forum Commoner
Posts: 64
Joined: Mon Dec 29, 2003 7:29 am

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

Post 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!
ilovetoast
Forum Contributor
Posts: 142
Joined: Thu Jan 15, 2004 7:34 pm

Post 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
Post Reply