Advance

How to Enable Cron Jobs on cPanel host

[Updated] As a Unix-like Operating Systems user, you may have used Cron as it is a useful utility. You can use it to schedule commands at a specific time. The schedules commands or tasks are known as Cron Jobs. Cron Jobs is one of the software features of control panels that are also available in the popular cPanel control panel and is using to execute commands at a specific time. To use Cron Jobs, you must copy the desired command to the host and enter its address in the Cron Jobs section. In this article, you will learn How to Enable Cron Jobs on cPanel host. Find your preferred VPS hosting plans and purchase one to be supported by the Eldernode team 24/7.

To let this tutorial work better, please consider the below Prerequisites:

A domain name (www.example.com)

A web hosting account that supports cPanel

cPanel username and password.

Tutorial Enable Cron Jobs on CPanel

There are three components for most Cron jobs:

1- The script that is to be called or executed.

2- The command that executes the script on a reoccurring basis. This is typically set in cPanel.

3- The action or output of the script, which depends on what the script being called does. While the scripts called Cron jobs would modify files or databases, they are able to perform other tasks that do not modify data on the server as well. (For example: send out email notifications)

Recommended Article: Tutorial Install SSL Certificate on IIS Web Server

What is a Cron Job?

You can use Cron Job to be able to automate commands or scripts on your site. The ”job” is a script that usually performs update tasks such as the list below:

1- Expiring user accounts

2- Sending out automated emails

3- Data visualization

4- Deleting user accounts

5- Updating tables

6- Maintenance tasks

7- Website updates.

How to set up a Cron job on cPanel step by step

Let’s go through the steps of this guide to review set up Cron jobs on cPanel.

Step 1:

First, log in to your cPanel control panel.

Step 2:

Then from the Advanced section, select the Cron jobs option.

Cron Jobs

Step 3:

In the Cron jobs page, enter the fields in the following order.

3-1 In the first field, you must enter your email to send execution reports after running the script.

Current Email

3-2 In the common setting section, you must select the time you need to run.

3-3 And in the command section, enter the desired script address.

Note: You can use the following command to enter a command to run a script in the public_html folder.

Add new cron job Command

PHP command examples:

General example:

php -q /home/username/public_html/one/cron.php
/usr/local/bin/php /home/username/public_html/path/to/cron/script

Domain-specific example:

/usr/local/bin/ea-php7 /home/username/domain_path/path/to/cron/script

After entering the required information, click on Add new Cron job.

Add new Cron job

 

The intervals for the Cron scheduling can enter in the above corresponding boxes. Here is the explanation of the.

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.

Step 4:

After completing the steps, you will see that the desired Cron jobs have been added. You can now schedule a command using the Cron Jobs tool within cPanel.

Recommended Article: How to Enable Cron Jobs on cPanel host

Conclusion

In this article, you learned How to Enable Cron Jobs on cPanel host. Cron allows you to run scheduled backups, monitor disk space, delete unnecessary files, run system maintenance tasks, and so on. In case you are interested in reading more, find our related articles on cPanel tutorials.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave Your Comment

Your email address will not be published.

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+18054214518

7 days a week, 24 hours a day