cPanel - Advanced - Cron Jobs
A cron job is a Linux command used for scheduling tasks that runs assignments at prescribed times. These activities are referred to as Cron jobs, and they are typically used to optimize security management or management..
The Cron Job Interface allows you automate tasks by running commands or scripts on your site at scheduled times, daily, weekly, or whenever you choose. For example, you could create a cron job to automatically delete temporary files each week, helping to free up disk space.
Note: Exercise caution when scheduling Cron Jobs. We recommend that you allow enough time between cron jobs for the previous cron job to complete.
If you schedule them to run too often, the server could start another cron job before the last cron job ends. This duplication could degrade Server or website performance.
For more information, see Red Hat’s Scheduling a Cron Job documentation.

Adding a Cron Email
The Cron Email section of the interface allows you to enter an email address for the system to send notifications when your cron jobs run. To set an email address, perform the following steps:
1) In the Email text box, enter the email address at which you wish to receive the notifications.
2) Click Update Email.
Disable email notifications
To disable email notifications for all cron jobs, remove the email address.
To disable email notifications for a single cron job, perform the following steps:
1) Locate the cron job for which to disable email notifications in the Current Cron Jobs table and click Edit.
2) In the Command text box, add the/dev/null 2>&1 line to the end of the command.
For example:
/usr/local/cpanel/bin/is_script_stuck /dev/null 2>&1
3) Save your changes.
Add a cron job
To create a cron job, perform the following steps:
1) Select the interval at which you wish to run the cron job from the appropriate menus, or enter the values in the text boxes
- • Common Settings - Select a commonly-used interval. The system will configure the appropriate settings in the Minute, Hour, Day, Month, and Weekday text boxes for you
- • Minute - The number of minutes between each time the cron job runs, or the minute of each hour on which you wish to run the cron job
- • Hour - The number of hours between each time the cron job runs, or the hour of each day on which you wish to run the cron job
- • Day - The number of days between each time the cron job runs, or the day of the month on which you wish to run the cron job
- • Month - The number of months between each time the cron job runs, or the month of the year in which you wish to run the cron job
- • Weekday - The days of the week on which you wish to run the cron job
2) In the Command text box, enter the command that you wish the system to run.
Important: You must specify settings for the Minute, Hour, Day, Month, Weekday, and Command text boxes.
Exercise extreme caution when you use the rm command in a cron job. If you do not declare the correct options, you may delete your home directory’s data.
If your cron job runs a custom script, the script requires the execute permission. For more information, read Red Hat’s Linux Permissions documentation.
Note: Specify the absolute path to the command that you wish to run. For example, if you wish to run the public_html/index.php file in your home directory, enter the following command:
/home/user/public_html/index.php
3) Click Add New Cron Job.
Cron job example
To run a script that resides in your home directory once an hour, perform the following steps:
1) In the Common Settings menu, select the Once Per Hour(0 * * * *) option.
2) In the Command text box, enter the script’s name. For example:
./my-script.sh
Remember: You must set the correct file permissions to allow a script to execute.
3) Click Add New Cron Job. The interface will display a success message.
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:
1) Locate the cron job that you wish to edit and click Edit.
2) 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:
1) Click Delete next to the cron job that you wish to delete.
2) Click Delete.
YouTube video on cPanel Tutorials - Cron Jobs
Related cPanel Tutorials and How To Guides
Simple to use hosting dashboard fix website issues yourself
Tweet Share Pin Email
Add Comment
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
- Your name, rating, website address, town, country, state and comment will be publicly displayed if entered.
- Aside from the data entered into these form fields, other stored data about your comment will include:
- Your IP address (not displayed)
- The time/date of your submission (displayed)
- Your email address will not be shared. It is collected for only two reasons:
- Administrative purposes, should a need to contact you arise.
- To inform you of new comments, should you subscribe to receive notifications.
- A cookie may be set on your computer. This is used to remember your inputs. It will expire by itself.
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
- Although the administrator will attempt to moderate comments, it is impossible for every comment to have been moderated at any given time.
- You acknowledge that all comments express the views and opinions of the original author and not those of the administrator.
- You agree not to post any material which is knowingly false, obscene, hateful, threatening, harassing or invasive of a person's privacy.
- The administrator has the right to edit, move or remove any comment for any reason and without notice.
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
What is the Difference Between Bootstrap and CSS
What is the Difference Between Domain Names and Website Hosting
What is the Difference Between Facebook and a Website
Understanding 404 Error Pages - Everything You Need to Know
Comments