HostMonster Web Hosting Help
Cron Job Basics
This article will provide an overview of what Cron Jobs are. If you are unfamiliar with Cron Jobs, please read this carefully as Cron Jobs are a more advanced feature of your account. If you are familiar with Cron Jobs and simply want instructions on using Cron Jobs, please refer to this list of Cron Job articles:
- Cron Job Basics
- Setup, Remove, or Edit a Cron Job
- Crons Running at Specific Date and Time
- Specify a Cron Job to use a Specific php.ini File
- Cron Jobs with PHP and other File Types
What is a Cron Job?
A Cron Job is a Linux command for scheduling a task (command). Cron Jobs allow you to automate certain commands or scripts on your server to complete repetitive tasks automatically.
This can be a very resourceful tool as a Cron Job can be set to run by the minute, hour, day of the week, day of the month, month, or any combination of these.
For example, you could set a Cron Job to delete temporary files every week so that your disk space is not being used up by unnecessary files. Some scripts, such as Drupal, may even require you to set up a Cron Job to perform certain functions.
WARNING! It is important that you familiarize yourself with how Cron Jobs work. You need to have a good knowledge of Linux commands before you can use Cron Jobs effectively.
Check your script with your hosting administrator before adding a Cron Job.
For most Cron Jobs, there are three components present:
- The script that is to be called or executed.
- The command that executes the script on a reoccurring basis. This is typically set in the cPanel.
- The action or output of the script, which depends on what the script being called does. Frequently, scripts called as a Cron Job modify files or databases, however they can perform other tasks that do not modify data on the server, like sending out email notifications.
For additional information on Cron Jobs, use the following resources: