How to setup cron job in cPanel to execute a URL

How to setup cron job in cPanel to execute a URL

Many times we have been asked how to use the command line script ?wget? to run programs via http links. (Most commonly used by Sendroid Ultimate)

This method works just like typing the URL on your web browser. The great thing about wget command is that unline the other methods, this options allows you to use all HTTP request features such as $_SERVER variable within your script, even when it is being called by cron tab. 

Here is an example of the wget script in action:

wget -q -O /dev/null "http://mysite.com/cronjob.php" > /dev/null 2>&1

Using-Omeans that the output of the web request will be sent to STDOUT (standard output).

>/dev/null 2>&1 will instruct standard output to be redirect to a black hole. So no message from the executing program are returned to the screen.

Below is a screenshot of using wget for a cron job in cPanel :

Share this post