Today's Question:  What weekend projects have you created?        GIVE A SHOUT

Technical Article => Web =>  PHP

Cron Job in cPanel with PHP

  Tim      2011-04-26 09:48:40      3,486    0

Running PHP scripts automatically can have some big benefits. You can wait to have things get done when there is less traffic on your server, or you can ensure daily tasks get done on time.

cPanel Simple Cron
Even if you do not know anything about cron jobs, and have never run a cron job before - you can get started with the simple cron tool built into cPanel. The url for it is:

A few things you'll need is the path to php and the path to the script that you'll be running. You will need the full path to do this. If your path to PHP differs then the one below, then change it - otherwise keep it as is. Don't know the path? This is most likely correct for you, just keep an eye out to see if the script does indeed run.

The command to run:
/usr/local/bin/php -f /home/(username)/public_html/(scriptname).php

Next you'll want to select an option from all the select boxes. Remember to select an option in each box. If you want something to run every day at 4AM, select Minute: 0; Hour: 4; Day: Every; Month: Every; Weekday: Every;

Click save and you are all set! You'll get an email every time the cron job runs, but if you don't want to get it - put :blackhole: into the output email field at the top.

Source :



Share on Facebook  Share on Twitter  Share on Google+  Share on Weibo  Share on Reddit  Share on Digg  Share on Tumblr    Delicious



No comment for this article.


try and catch in simple

By sonic0002