What is a cron job?
The cron daemon is a long running process that executes commands at specific
dates and times. To schedule one-time only tasks with cron, use at or batch. For
commands that need to be executed repeatedly (e.g. hourly, daily or weekly).
How to start Cron
We will provide here instructions for CPanel-based control panel. I hope you
will be able to find equivalent controls if your hosting uses different panel
software.
- Login into your webhosting control panel (http://example.com/cpanel/).
You will see a screen like:
- Click to Cron Jobs link. It may be also hidden in Tools or Advanced
submenu. You will see screen offering you to choose your expirience level.
- Choose Advanced. You will see the following screen:
Into the empty bottom line, enter:
Minute = 0
Hour = * (every hour)
Day = * (means every day)
Month = *
Weekday = *
Command = wget -qb http://yourdomain.com/cron.php
Of course, replace yourdomain.com to your actual domain name. Ensure that this URL works, first try to open it from your browser. Click Commit Changes.
- On the next day, if you receive e-mail notifications from "Cron Daemon"
that says that something is wrong with your command, please read it
carefully. It means that your cron job doesn't work. If it says "Command not
found" , try to use the following command lines:
/usr/bin/curl -s http://yourdomain.com/egbusiness/cron.php
/usr/local/bin/curl -s http://yourdomain.com/egbusiness/cron.php
/usr/bin/wget -o/dev/null -O- http://yourdomain.com/egbusiness/cron.php
/usr/local/bin/wget -o/dev/null -O-
http://yourdomain.com/egbusiness/cron.php
- Command might be different, depends on your host server. If the command
is not running well, you can call your webhost. If nothing helps, you can
use an external cron service, you may search cron service at google with
keywords "cron service".