Loader

Knowledgebase

How to Setup Cron Job in Cpanel Last Modified: 2015-10-19


Views : 1381 Print Article

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 — This menu allows you to select a commonly-used interval. The system will configure the appropriate settings in the MinuteHourDayMonth, and Weekday text boxes for you.

      Note:

      If the wildcard characters (*) and intervals confuse you, this menu is an excellent way to learn how to configure the other fields.

    • Minute — Use this menu to select 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 — Use this menu to select 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 — Use this menu to select 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 — Use this menu to select 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 — Use this menu to select 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.

    Notes:

    • Specify the absolute path to the command that you wish to run. For example, if you wish to run the public_html/index.php file in your home directory, enter the following command:

      /home/user/public_html/index.php

      To disable notifications for a specific cron job, add the following line to the command:

      >/dev/null 2>&1

    Important:

    • You must specify settings for the MinuteHourDayMonthWeekday, and Command text boxes.
      • The interface displays a green checkmark icon () next to each setting that you properly set.
      • If you enter or select an invalid setting, the interface displays a red warning icon () next to that setting.
    • Exercise extreme caution when you use the rm command in a cron job. If you do not declare the correct options, you may delete your home directory's data.
  3. Click Add New Cron Job.








Google+ RSS
Google Post



© Sanvi Software Ptv Ltd 2016 | Dhru™ | Smart Lifestyle™ | Dhru Cloud™

Privacy Policy | TOC

Go to TopBack to Top