How to set up cron job in cPanel? Print

  • 0

What is Cron?

Cron has 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.

Note:

Exercise caution when you schedule cron jobs. If you schedule them to run too often, they may degrade your server’s performance.

Locate Cron Jobs

1. Login to cPanel.

2. Locate Cron Jobs from the ADVANCED section.

Add a Cron Email

The Cron Email section 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.

Add a cron job

To create a cron job, perform the following steps:

Common Settings – commonly used time and date interval. The cPanel will give suggestions on what cron job you may want to use.

  • 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.

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

Note:

You should make sure to enter the proper command and the full path to the file.

(for eg.: /usr/bin/php /home/user/public_html/cron.php).


Was this answer helpful?

« Back