How to set up Drupal cron job using cPanel

This tutorial is to show you how to set up your Drupal site to run the cron successfully.

Cron is an important part of Drupal. Cron is used for retrieving syndicated RSS feeds from other sites and syndicate datas from your own site. Cron is also used by many other Drupal modules to handle required background processing.

System Requirements

  1. Latest version of Drupal
  2. Server OS: Linux
  3. Server: Apache
  4. Website Backend: Cpanel

The Cron Script

Drupal comes with two version of the cron script, which we can find in the drupal directory.( /public_html/

We are using for this tutorial.


Edit the script


Go to Cpanel and set the permission of to 755 ( /public_html/ After changing the permission open the and you can see the following line already exist in the

#!/bin/sh # $Id:,v 1.3 2006/08/22 07:38:24 dries Exp $ /usr/bin/lynx -source > /dev/null 2>&1

Change > /dev/null 2>&1 to > /dev/null 2>&1 

Note: You should write your real site name here.

Now copy the path to (Which you can find on top left side of editing panel) and save the file after you have finished editing.

Cron Jobs


On the Cpanel homepage click on the button Cron jobs and create a new cron job by setting the time interval for cron to run.

You can set the time interval as often as every minute or every hour and so on.

  1. * * * * * (Every minute)
  2. */5 * * * * (Every 5 minutes)
  3. 0,30 * * * * (Twice an hour)
  4. 0 * * * * (Once an hour)
  5. 0 0,12 * * * (Twice a day )
  6. 0 0 * * * (Once a day)
  7. 0 0 * * 0 (Once a week)
  8. 0 0 1,15 * * (1st and 15th)
  9. 0 0 1 * * (Once a month)
  10. 0 0 1 1 * (Once a year)

On command copy and paste the ull path to cron.php (/home/sitename/public_html/cron.php)

Command should look like this;

  1. For Primary (main) Domain

php /home/sitename/public_html/cron.php

2.  For Addon Domain/Sub Domain

php /home/sitename/public_html/

Note: Make sure that you have given a single space after php.

1. php /home/sitename/public_html/ [GOOD]

2. php/home/sitename/public_html/ [BAD]

Verify Cron job

We have to make sure that the crontab is working properly, inorder to check that let's set cron job to run every minute (* * * * *).

Now go to your site admin>logs and if you see a message somthing like Cron run completed everything is OK, if not double check the whole process again.


Now go back and set the time interval rom every minute to every hour or the time interval you want cron to run.

I hope you could find this tutorial helpul. If you have anysuggessions or comments please write it below.