What are Cron Jobs?
Cron jobs are scheduled tasks performed automatically by the system at predefined times or intervals. Basically, a cron job contains a series of simple tasks that run from a script file.
Adding a Cronjob in cPanel standard mode
- Firstly, Click on the icon Cronjob in cPanel on the main screen of your cPanel interface.
- Secondly, Click on Standard to access the Standard Cron Manager.
- Thirdly, Enter the email address you wish the output of the command run by the cronjob to be sent to in the field Will be sent: under Cron Email section.
**Note: If you want to disable email notifications, you can add the/dev/null 2>&1
line to the end of the command. - Next, Enter the command you wish the cronjob in cPanel to run in the Command text box.
- After that, Select the interval you wish the command to be run by selecting an option in each of the boxes.
- Then, Click on Add New Cron Job to save your changes and set up your cronjob.
Adding a cronjob in advanced mode
- Firstly, click on the icon Cronjobs on the main screen of your cPanel interface to access the Cronjobs Menu.
- Secondly, Click on Advanced (Unix Style) to access the Cron Manager.
- Thirdly, Enter the email address you wish the output of the command run by the cronjob to be sent to in the field Will be sent: under Cron Email section.
- Next, Enter the command you wish the cronjob to run in the Command text box.
- After that, Select how often you wish the command to be run by placing a number or * in each of the boxes.
- Lastly, Click on Add New Cron Job to save your changes and set up your cronjob.
Editing a cron job
- Firstly, login to cPanel.
- Next, click Cron Jobs under ADVANCED section in the home screen.
- Then, click Edit for the cron job you want to edit under Current Cron Jobs section.
- Lastly, click Edit Line.
Deleting a cron job
- Firstly, login to cPanel.
- Secondly, click Cron Jobs under ADVANCED section in the home screen.
- Next, click Delete for the cron job you want to delete under Current Cron Jobs section.
- Lastly, confirm again and click Delete.
We hope this article helped you to learn about how to create and manage cronjob in cPanel. For more articles, please go to Knowledge Base.