Cron jobs are set of codes, tasks or commands that are scheduled to run at a specific or prearranged time and intervals. A software utility program that runs on Unix and Linux environment called Cron, executes these scheduled script files created in cPanel in order to automate reoccurring tasks that are needed to perform certain functions required by your website.
Setting up a Cron job is essential to the operation of your website because it allows you to perform tasks every minute, hour, day, week, or month without the need of being physically present to operate these commands. A good example of using this feature would be setting up a Cron job that deletes all temporary files every day, in order to free up your server disk space of unnecessary data.
A Cron job must have the following components present:
To set up a Cron job in cPanel, all you need to do is follow the simple instructions given below.
Step 1: Login to cPanel
Step 2: In the cPanel Home screen, locate the “Advanced” section
Step 3: In the Advanced section, click on the Cron Jobs Icon
Step 4: In the Cron jobs menu interface, enter the email address where you want the Cron job report to be sent every time the job is executed and click on the “Update email” button
Step 5: In the Command field located at the bottom of the Cron jobs interface screen, enter the command or script that you want the Cron utility to run.
Step 6: After entering the command that you want the Cron utility to run, select how often you wish the script or command is to be executed by filling out the time options settings in the Minute, Hour, Day, Month, and Weekday settings or you can alternatively choose a predefined schedule from the “Common Settings” drop down list.
Step 7: After selecting a schedule for your Cron Job, click on the “Add New Cron job” button in the bottom of the screen to save your settings.
Step 8: After completing the steps above, you now have successfully created your Cron job.
After creating your Cron jobs, time will come that you will no longer need to run these scheduled tasks. To remove or delete a Cron job, do the following steps:
Step 1: In cPanel, access the Cron jobs menu interface
Step 2: In the Cron jobs menu interface, locate the Cron job that you wish to remove or delete
Step 3: Click the “Delete” button next to the Cron job that you wish to delete or remove.
Step 4: After clicking on the Delete button, the selected Cron job will be removed from the list.