Loading...

Knowledge Base
Save up to  70% off.  Start your website today!

How do I Create and Delete a Cron Job?

 

Cron jobs run scheduled commands at specific times. The Cron Jobs tool in cPanel helps set up automated maintenance and other unmanned server duties.

Warning: You need to have a good knowledge of Linux commands before using cron jobs effectively. Check your script with your hosting administrator before adding a cron job.

For more detailed information on how cron works, please see:

This article discusses the following topics.


How to create a Cron job

  1. Log in to cPanel. There are two ways to access your cPanel.
    • Option 1: Access your cPanel via direct link.
    • Option 2: Access your cPanel via your Customer Portal.
      1. Log in to your Customer Portal.
      2. Click the Hosting tab in the left-side menu.

        Customer Portal - Hosting tab

        • If you have one hosting package in your account, proceed to step 3.
        • If your account has multiple hosting packages, choose the plan you want access to, then click Manage.

          Customer Portal - Hosting Packages

      3. Scroll down to the Server Information section.
      4. Under Quick Links, click the cPanel button.

        Customer Portal - Quick Links - cPanel button

  2. In the Advanced section, click Cron Jobs.

    cPanel - Advanced - Cron Job

  3. Under Cron Email, make sure the current email address is valid. If not, enter a new, valid email and click Update Email. You will receive an email after the cron job has finished.

    cPanel - Cron Email

  4. Under Add New Cron Job, use the Common Settings dropdown menu to choose from a list of regularly used intervals, or set the frequency of your cron job by using the dropdown box next to each time unit. Common settings range from every minute to once a year.

    Cron Job - Common Settings

  5. In the Command field, enter the desired command.

    Add New Cron Jobs - Command field

  6. Click Add New Cron Job.

Your cron job will now execute a file at a specific time, date, and repetition according to the settings you entered.


How to edit or delete a Cron job

  1. Within the Advanced section of cPanel, click the Cron Jobs icon.

    cPanel - Advanced - Cron Job

  2. Scroll down to the Current Cron Jobs section.
  3. Locate the cron job you need to manage.
  4. Under the Actions column, click Edit or Delete.

    Edit or Delete Cron

Note: The Edit panel has fewer common settings to choose from, so if you are having trouble getting the correct interval, copy the command, delete the cron job, and recreate it as instructed above.

 

Did you find this article helpful?

 
* Your feedback is too short

Loading...