Knowledge base
Cron jobs: what are they, and how to use them

Under UNIX, Periodic execution is handled by the cron daemon. Individual tasks to be executed are commonly referred to as cron jobs, and are stored in a single file called a crontab.
Each crontab has the same format:
minute hour day month weekday commandWhether within Cpanel or directly in the file, each crontab will have the above format, and each field can contain:
- A Star, which matches everything
- A single number
- Two numbers seperated by a dash, which matches a range.
- A comma-seperated series of numbers or ranges, which matches any listed value.
Examples:
50 11 * * 1-5Means 11:50am, Monday through Friday.
55 15 * * 0-3,6Means every day except Thursday and Fridays at 3:55 p.m.
One of the most common uses for cron jobs will be to execute a PHP file on a periodic schedule, the best way to do this is:
php -q /home/username/public_html/path/to/script > /dev/null lynx -dump http://site.com/fil.e.php > /dev/null
The above two commands will execute the php script.
Cpanel allows for a e-mail address to be entered, if you would like to receive the output from the commands; you should enter your e-mail address, however it’s not neccessary.
Categories
Getting started:
Cpanel control panel:
- How do I access my control panel?
- How do I access the Fantastico auto-installer?
- Awstats: Error: LogFile parameter
- Access your Cpanel before your domain has propagated
- Cron jobs: what are they, and how to use them
Webhost manager (WHM):
- Do not change the username or domain name for any of your domains
- Always let WHM finish the current process
- Do not use hyphens or underscores in usernames
- Access all accounts with the WHM password
- Setting strong passwords
Questions and tips:
E-mail:
- Blocking all mail to an e-mail address
- What are the SMTP and POP server addresses?
- Mailing lists: limits of usage
- What happens to e-mail when the server is down: is it returned to the sender or lost?
- How do I access webmail for my account?
Domains and DNS:
FTP and files:
- What are the FTP timeout settings?
- The public_html and www directories
- What is the maximum number of FTP connections per user?
- What is the max number of files/directories I can display in FTP?
- File permissions explained
Htaccess magic:
CGI, PHP and Perl:
- What is the path to..?
- Formmail: important notes
- ImageMagick
- SuExec: what it is and how it affects your scripts