Setup, Remove, or Edit a Cron Job
This article will provide instructions on how to setup, remove or edit a Cron Job. If you need a different explanation on 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
Cron jobs allow you to automate certain commands or scripts on your site. You could set a command or script to run at a specific time every day, week, etc. For example, you could set a cron job to delete temporary files every week to free up disk space.
- Log in to your Bluehost control panel.
- Locate the Cron Job Icon:
- From the Advanced tab from the side navigation menu to the left, then look for the Advanced section.
- Click the Cron Jobs icon.
- Select the cpanel tab from the navigation menu that stretches across the top of your screen.
- Scroll down and under the advanced section, click the Cron Jobs icon.
- Make sure the current email address is valid. Enter a new email and click the Update Email button.
- Common Settings– You can use this drop-down list to populate all but the last fields.
- Minute – The minute setting for the cron job.
- Hour – The hour setting for the cron job.
- Day – The day setting for the cron job.
- Month – The month setting for the cron job.
- Weekday – The weekday setting for the cron job.
- Command – The cron job command to execute. If you want to execute a script, then it would look similar to the command below.
/usr/local/bin/php -c /home/username/public_html/myscript.php
- Set the frequency of your Cron Job by using the drop-down box for each setting, or use the Common Settings to choose from a list of regularly used intervals. Common Settings include every 15 minutes to once a year.
- Enter in the desired command and click the Add New Cron Job button.
You have just created a Cron Job to execute a file at a certain time and date with the desired repetition.
View existing cron jobs
The Current Cron Jobs table displays your existing cron jobs.
Edit a cron job
To edit a cron job, perform the following steps:
- Locate the cron job that you wish to edit and click the Edit button.
- Edit the settings that you wish to change and click Edit Line.
Delete a cron job
To delete a cron job, perform the following steps:
- Click the Delete button next to the cron job that you wish to delete.
- Click the Delete button again to delete it successfully.