The CRON Command is in the Following Format:
[ Minute - Hour - Day - Month - Weekday ] - Command
The COMMAND, can be broken down in:
[PATH OF PHP] [ARGUMENTS] [PATH OF PHP SCRIPT]
So the COMPLETE CRON command can be written as:
[ Minute - Hour - Day - Month - Weekday ] [PATH OF PHP] [ARGUMENTS] [PATH OF PHP SCRIPT]
The timing is spedified using * symbols:
* * * * * => Execute every minute
0 * * * * => Execute every Hour
0 0 * * * => Execute every mid-night
0 0 0 * * => Execute every Month
0 0 0 0 * => Execute every Weekday
Since this is a UNIX command, You will have to Mention the PATH of PHP:
PATH TO PHP : /usr/local/bin/php
~OR~
PATH TO PHP : /usr/bin/php
These are the Possible Command line Arguments you can use. This will effect the output.
In our case, we will use the -q ( Quiet mode ) argument, which is most commonly used:
-a Run interactively
-b
| Bind Path for external FASTCGI Server mode
-C Do not chdir to the script's directory
-c | Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f Parse . Implies `-q'
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-q Quiet-mode. Suppress HTTP Header output.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z Load Zend extension .
The Path of the PHP file Must be Complete absolute path.
If your USERNAME is "shoorace", Your path will be:
/home/shoorace/public_html/
I assume you are familier with the PUBLIC_HTML directory. That is the Root folder where you store your html files.
So lets say that "shoorace" wants to execute my script "autotrigger.php" every hour. And it is stored in "public_html/cron/autotrigger.php".
Here, is cron is user created folder, ie not default.
So the Complete CRON command for every hour would be ,
0 * * * * /usr/bin/php -q /usr/home/shoorace/public_html/cron/autotrigger.php
Snapshot for cpanel > Advanced (Unix Style):