KNOWNHOST KNOWLEDGE BASE

Hosting Question? Find the Solution - Browse our Guides, Articles, and How-To's

How to set up Cron Jobs in cPanel?

Category: cPanel
Tags: # # # # #

Cron Job is a linux command designed to deploy scheduled tasks. cPanel has a specific option called “Cron Jobs” through which you can set up cron jobs using a graphical user interface.


Cron Job Structure

how cronjobs are setup from first to last:

  *     *     *   *    *        command to be executed
  -     -     -   -    -
  |     |     |   |    |
  |     |     |   |    +----- day of week (0 - 6) (Sunday=0)
  |     |     |   +------- month (1 - 12)
  |     |     +--------- day of        month (1 - 31)
  |     +----------- hour (0 - 23)
  +------------- min (0 - 59)

To further explain the above, let us use an example and take a look at how cPanel schedules the automatic upgrade process:

  47 16 * * * /usr/local/cpanel/scripts/upcp --cron

1) The minute (47)
2) The hour (16 or 4)
3) Day of the month (* means everyday)
4) Month (* means everyday)
5) day of the week (* means everyday)
6) The actual command to be executed (/usr/local/cpanel/scripts/upcp –cron)


Now, let us setup cron job using cPanel.

1. Log in to cPanel using Username Password. i.e; (https://yourdomain.com:2083 or https://yourdomain.com/cpanel)

2. Navigate to ADVANCED Cron Jobs.

navigate-to-cron-jobs

3. Scroll down and navigate to “Add New Cron Job“. Fill in the necessary information,

Common Settings: Here, you can find a list of all the predefined rules; at selected scheduled times cron job will execute the provided command.

common-setting-of-cron-jobs

Minute: You can enter the custom value or select the option from Command Settings.

Hour: You can enter the custom value or select the option from Command Settings.

Day: You can enter the custom value or select the option from Command Settings.

Month: You can enter the custom value or select the option from Command Settings.

Weekday: You can enter the custom value or select the option from Command Settings.

Command: Paste command, which will be executed in the cron job.

enter-the-cron-job-scheduled-manually

4. Finally, to deploy the cron job → Click on “Add New Cron Job“.

How-to-set-up-Cron-Jobs-in-cPanel

Conclusion

Now that we’ve gone over how to set up cron jobs using cPanel. Automate your scheduled task at the correct time without missing it using the cron job feature of cPanel.

KnownHost offers 365 days a year, 24 hours a day, all 7 days of the week best in class technical support. A dedicated team is ready to help you should you need our assistance. You’re not using KnownHost for the best web hosting experience? Well, why not? Check with our Sales team to see what can KnownHost do for you in improving your web hosting experience.