Introduction and overview
Cron jobs are commands used to schedule tasks that must run repeatedly, for example, every Saturday and Sunday at 12 PM. These jobs allow you to automate some commands and scripts on your server, to make it easier to run repetitive tasks. For instance, you could create a cron job to send notices through email every X days. This is a system process that runs in the background.
How to Create/Use
Cron jobs can be controlled via cPanel.
- Connect to your control panel and click on Advanced Tools > Cron Jobs.
- Click on Standard or Advanced, depending on your level of experience (Standard is recommended).
- Specify the command to run, its schedule, and click on Add New Cron Job.
To run a PHP script called
script.php located in your
/public_html/ folder, you can use the following Cron command:
/usr/local/bin/php -q /home/[username]/public_html/script.php > /dev/null
by the path to your script.
By default, the cron job sends a confirmation of successful execution after each run. By adding
at the end of the command, you specify to the task that it should not send you an email.
- 5 Users Found This Useful
On a shared web hosting server, all users share a finite amount of resources at any given...
Wildcard subdomains are a useful cPanel feature that allows you to direct non-existing subdomains...
cPanel is a control panel with which you can manage almost any element of your cPanel hosting...
You can do this by running this command in SSH: /usr/local/cpanel/cpkeyclt It should...
Often while troubleshooting your client's mail issues, you will be required to find out which...