Share This Post

Overview

Cron jobs are scheduled tasks that the system runs at predefined times or intervals. Typically, a cron job contains a series of simple tasks that the system runs from a script file.

Add a cron email

The Cron Email section of the interface allows you to enter an email address for the system to send notifications when your cron jobs run. To set an email address, perform the following steps:

  1. In the Email text box, enter the email address at which you wish to receive the notifications.

  2. Click Update Email.

Disable email notifications

To disable email notifications for all cron jobs, remove the email address.

To disable email notifications for a single cron job, perform the following steps:

  1. Locate the cron job for which to disable email notifications in the Current Cron Jobs table and click Edit.

  2. In the Command text box, add the/dev/null 2>&1 line to the end of the command. For example:

    /usr/local/cpanel/bin/is_script_stuck /dev/null 2>&1
  3. Save your changes.

Add a cron job

To create a cron job, perform the following steps:

  1. Select the interval at which you wish to run the cron job from the appropriate menus, or enter the values in the text boxes.

    • Common Settings — Select a commonly-used interval. The system will configure the appropriate settings in the MinuteHourDayMonth, and Weekday text boxes for you.

    • Minute — The number of minutes between each time the cron job runs, or the minute of each hour on which you wish to run the cron job.

    • Hour — The number of hours between each time the cron job runs, or the hour of each day on which you wish to run the cron job.

    • Day — The number of days between each time the cron job runs, or the day of the month on which you wish to run the cron job.

    • Month — The number of months between each time the cron job runs, or the month of the year in which you wish to run the cron job.

    • Weekday — The days of the week on which you wish to run the cron job.

  2. In the Command text box, enter the command that you wish the system to run.

      3. Click Add New Cron Job.

Cron job example

To run a script that resides in your home directory once an hour, perform the following steps:

  1. In the Common Settings menu, select the Once Per Hour(0 * * * *) option.

  2. In the Command text box, enter the script’s name. For example:

    ./my-script.sh

     3. Click Add New Cron Job. The interface will display a success message.

View existing cron jobs

The Current Cron Jobs table displays your existing cron jobs.

Edit a cron job

To edit a cron job, perform the following steps:

  1. Locate the cron job that you wish to edit and click Edit.
  2. Edit the settings that you wish to change and click Edit Line.

Delete a cron job

To delete a cron job, perform the following steps:

  1. Click Delete next to the cron job that you wish to delete.
  2. Click Delete.

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Email Hosting Australia
Email

Email Deliverability in cPanel

Use this interface to identify problems with your mail-related DNS records for one or more of your domains. The system uses these records to verify that other servers can trust it as a sender.

Virus Scanner

Overview The Virus Scanner interface scans your cPanel account for security threats. If ClamAV® Virus Scanner identifies a security threat, the system prompts you to perform an

Do You Want To Boost Your Website?

Share your requirements with us and we will get in touch with you shorlty.

ask
anything...

Get in touch