How to Set Up a Cron Job in cPanel

January 18, 2021 / cPanel & WHM

A cron job is a helpful process that allows you to automate several essential web hosting tasks by setting up a command to run at scheduled intervals. This can include tasks like backing up your website or checking for updates.

Advisory guidance

While setting up a cron job is simple to do, it does require you to have a good knowledge of Linux commands. To avoid problems that can affect your website, we advise customers to check their script with our support team before they create a new cron job.

To set up a cron job, follow these instructions:

  1. Log in to cPanel
  2. scroll down to the Advanced section and click the Cron Jobs icon.
    Cron Jobs
  3. Option to change a notification email address. cPanel will send you an email notification every time the cron job runs. This will help you discover if the cron job fails to run. Your default email is listed in the Cron Email section. If you wish the notification to be sent to a different email address, type that address into the field below and click on the Update Email box.
  4. Next, scroll to the Add New Cron Job section.
    Add New Cron Job
  5. Here, you can set the frequency at which you want the cron job to operate. To simplify the setup, you can either select an option from the Common Settings in the dropdown menus or input your values.
    If you are not familiar with the input values, we recommend only using the common settings.
    There is a general Common Settings dropdown at the top (for running jobs once per minute, hour, month, etc.) and common settings for each of the other options. For example, you can choose which time of the day, days of the week, etc. a cron job runs.

    The example below shows a cron job set to run on the 1st and 15th days of each month.
    Common Settings

    Warning: If you run a cron job too frequently, it can reduce the performance of your server. cPanel recommends that you only run cron jobs once per day.
  6. Once you have set the frequency of the cron job, the next task is to input the command. Enter this in the Command field.
  7. When finished, click the Add New Cron Job button. A confirmation will appear to confirm that the cron job has been added. The cron job will then appear in the Current Cron Jobs section at the bottom of the page and you will receive a notification email every time it runs. 

That’s it!! This is the easiest way to schedule tasks. However , You can also Set up Cron job using the command line that helps to increase the overall performance of website and can streamline and automate various tasks.

Dominos Search