Cron Job Basics
This article offers an overview of the basics of Cron Jobs. If you're unfamiliar with Cron Jobs, please read on carefully, as they represent a more advanced feature of your account. For those already acquainted with Cron Jobs and seeking instructions on their use, please refer to the following list of Cron Job articles:
What is a Cron Job?
A Cron Job is a Linux command for scheduling a task (command). Cron Jobs allow you to automate specific 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 15 minute or hourly increments, a day of the week or month, or any combination of these. Bluehost limits Cron Jobs on shared servers to run in increments no less than every 15 minutes as excessive Cron Jobs can cause unnecessary loads on the server.
For example, you could set a Cron Job to delete temporary files every week so that unnecessary files do not use up your disk space. Some scripts, such as Drupal, may even require you to set up a Cron Job to perform certain functions.
Sample Cron Jobs Commands
- PHP command examples:
/usr/local/bin/php /home4/cemmlfmy/public_html/path/to/cron/script - Domain-specific example:
/usr/local/bin/ea-php99 /home4/cemmlfmy/domain_path/path/to/cron/script
Scheduling in Cron Jobs
To understand the settings in a Cron Job, you need to know how its scheduling works. A Cron Job is scheduled based on five time units represented by different fields. Here's what you need to know about these units:
- Minutes - Ranges from 0 to 59.
- Hour - Ranges from 0 to 23 (24-hour format).
- Day of the month - Rangers from 1 to 31.
- Month - Ranges from 1 to 12 (January to December).
- Day of the week - Ranges from 0 to 6 (Sunday to Saturday).
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 recurring basis. This is typically set in the cPanel.
- The action or output of the script depends on what the script being called does. Frequently, scripts are called a Cron Job to modify files or databases; however, they can perform other tasks that do not modify data on the server, like sending out email notifications.
Cron Job Limits
Shared Hosting
If you encounter errors while using the GET command, please contact us to request access.
VPS and Dedicated Server
You can schedule a Cron Job as frequently as you wish. By default, we allow GET and WGET.
Cron Job Environment
Sample Cron Job Page in cPanel:

- The initial working directory for the process is your home directory.
- Because the processes are run in a non-interactive shell, .bashrc and other startup files are not read.
- Only /usr/bin and /bin will be checked for the specified executable. Executables in other directories must be specified as absolute paths, such as /ramdisk/bin/php5, or relative paths, such as ./my_program.
- When running a script, the interpreter must be specified either in a valid #! line using a full path or at the command line.
- File arguments must be specified with absolute paths or paths relative to the current working directory.
Summary
Cron Jobs are perfect automation tools for server activities and running commands or scripts periodically. They are effective tools of efficient server management by virtue of their ability to set intervals between runs ranging anywhere between several minutes and months. It's important to understand Linux commands and conform to server specifications. Bluehost, for example, applies a minimum interval of 15 minutes on shared servers to avert overload. Though various types of servers apply different restrictions, the proper configuration of scripts takes center stage. By understanding and rightly using Cron Jobs, individuals can automate activities and tune server performance with ease.
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.