How to Set Up Cron Jobs using the cPanel Hosting Control Panel

Cron is a Linux daemon used to automate scheduled tasks (cron jobs) on a server. Cron jobs are very useful if you are running repetitive tasks on your website. For instance, if you a have a mailing list and you want to send a newsletter (e.g. daily), cron jobs can invoke the email sending functions without any manual input.

The Cron function is also used on subscription-based websites to create and send automatic recurring invoices and reminders about accounts expiration. Another possible usage is creating backup copies of website databases.

So, you can virtually automate any tasks on your website using the technology. In this guide, we are going to show you how to configure and setup cron jobs on your cPanel account.

Special Note: You can run a Cron job using cPanel. Most hosting services offers cPanel for free as part of their plan. If for some reason yours does not, consider switching to a hosting service. You will find the world’s best web hosting services on Hostadvice, along with expert and user reviews.

Prerequisites

  • A domain name e.g. www.example.com
  • A web hosting account that supports cPanel
  • cPanel username and password.

Step 1:
Log to your cPanel Account

You can access your cPanel account by typing www.example.com/cPanel . Remember to replace ‘example.com’ with the primary domain associated with your hosting account. Then, enter your cPanel username and password as shown below:

Step 2:
Search for cron jobs scheduler

Once you are in the dashboard enter ‘Cron Jobs’ on the text box that reads, “Find functions quickly by typing here:” and click the link that appears as shown below:

Step 3:
Updating cron email

On the next screen, you will see an option for setting up cron jobs and you can choose whether you want to receive an email once a cron job runs. To avoid getting a lot of emails in your inbox, you may enter your address here temporary for testing purposes and delete it once everything is up and running.

Click on ‘Update Email’ to save the changes.

Step 4:
Setting up a cron job

The next step is to add your first cron job by specifying the timings and the command as shown below:

Cron job timings

Minute: The exact minute when you want the cron job to run. It takes the values between 0 and 59

Hour:  This field accepts a value between 0 and 23. It specifies the exact hour when you want the cron to run e.g. 0 means the cron job will run exactly at midnight.

Day:  You can enter any value between 1 and 31. This field represents the day of the month. For instance, to run a cron job on the mid-month, enter ‘15’ as the value.

Month: Takes the value between 1 and 12. For instance, to schedule, a task for the month of October, use ‘10’ as your value.

Weekday: This is the day of the week; the allowed values are between 0 and 6(Sunday to Saturday)

Command:  Enter the command that you want to execute here (e.g. ‘wget https://www.example.com’)

Step 5:
Cron job examples

To schedule a task once per minute use the below settings

To run a cron job once at midnight, use the settings below:

Commas on commands

To run a command on the 1st and 15th day of the month, refer to the below settings:

To run a command on 3 am on the 1st day of January, use the settings below

Conclusion

That is the basic procedure of setting up cron jobs from your cPanel. You can tweak the settings as required depending on your timings. Remember to click the ‘Add New Cron Job’ once you have entered the right values in all fields. Cron jobs are very useful especially when running web applications on the internet. You will need them in one way or another to automate repetitive tasks and we believe this guide has shown you the basics of doing the same.

 

Check out the top 3 cPanel hosting services:

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
  • Want to get top recommendations about best hosting? Just click this link!

How to Delete Extra Database Tables After Uninstalling a WordPress Plugin

Not all the plugins come with an option to delete all the settings
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Edit WordPress's wp-config.php File Using cPanel

As I have mentioned earlier, this file is responsible for connecting your websit
3 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to deactivate all your WordPress plugins at once from cPanel

While handling a WordPress website, you may encounter with many common WordP
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Edit the CSS for your WordPress Site Using the cPanel Hosting Control Panel

As you know, the design of a WordPress website is controlled by
4 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top