Last updated April 1, 2016. Created on February 4, 2009.
Edited by krina.soni, vwX, Francewhoa, peterx. Log in to edit this page.

cPanel controls domains and has an option to configure cron jobs. Here is everything you need to configure cron jobs in cPanel.

cPanel formats pages based on styles. This document is based on the sundaymorning style. The location of options might vary if you use a different style. You can change the style using the Change Style option in cPanel. In the sundaymorning and Crimson smoke themes, you select Advanced then Cron jobs.
Part of the cPanel main screen showing the advanced section containing the cron jobs icon

WHM, Web Host Manager, is the cPanel product for controlling domains in a Virtual Private Server. If there is no cron option in your cPanel, you may have to add cron in WHM. Cron may be in different places in the various Cpanel themes.

You may be offered the option of standard or an advanced Unix style user interface. You may see an error message similar to the following.
/usr/bin/crontab permissions are wrong. Please set to 4755

The Unix style interface dumps you in a page where you can enter a command the same as described on the main Configuring cron jobs page.

The standard page lets you select the number of minutes, hours, days, or months from selection lists and add the final part of the command.

The following image shows the add new cron job section of the cron page including the drop down selection boxes and the final text box for your command. Some of the boxes are explained next.

The cPanel cron jobs screen showing the add new cron job section

The Common Settings drop down lets you select every hour, every day, and other useful options. Select Once a day (0 0 * * *) as an example. That sets the minute and hour options to zero indicating midnight. The same selection sets day, month, and weekday to * to indicate every day of every month on every day of the week.

You can then change the minute or hour to a less busy time. For example, some Australian sites are busy at midnight handling requests from America where it is the start of the business day.

An easy way to start the Drupal cron job is to execute the file in some way. Lynx is a text based Web browser that accepts a URL as a parameter. You can start Lynx from cron and specify the Drupal cron job in the source parameter.

The following image shows the final command to run /usr/bin/lynx every day at 6 am using as the source. This makes the Web server at execute cron.php. Cron.php is the Drupal cron command.

The cPanel cron jobs screen showing the command section

The following image shows the command in the edit option. You can see the relationship between the components of the command and the previously mentioned drop down boxes.

The cPanel cron jobs screen showing the command in the edit option

Drupal 7

For Drupal 7 you have to add a security string as specified in a Drupal 7 administration page. Go to Administration › Reports › Status report and look for a string similar to the following example. Use the full string in the cPanel cron command box.

Drupal 7 also includes a reworked Poormanscron at Administration › Configuration › System › Cron. Poormanscron only works when people visit your Web. Low activity Web sites still need the cron in cPanel.

Poormanscron gives you limited control of when cron runs, you can say once per day but not when, sending you back to the cPanel cron if want to restrict the cron activity to a specific time range. In this case you have to set the Drupal cron to never so there is no cron activity outside of your cPanel cron.

Many Web sites on one server

When you have many Web sites on one server, you might want to spread the cron jobs out by a few minutes to reduce the concentration of activity. I have cron jobs separated by 3 minutes from midnight until 6:00 am.

You can look in your activity logs to pick the best time. cPanel offers Webalizer, Awstats, and Analog with Webalizer as the default. Look at the activity for the Web site where the Drupal cron.php runs, not the site where cron runs. Cron performs very little work. Cron.php does the hard work.

Lynx or Wget or Curl

The Web site for Lynx is The Web site for Wget is Lynx is a Web browser and does not require parameters to read cron.php. Lynx is the easiest way to activate cron.php but Lynx is not installed by default in all versions of Linux.

Some people use wget. Wget is installed by default in Ubuntu Linux. Wget gets files and needs special parameters to get a Web page. Note that wget is not semantic. The decorative upper case -O is a different option to the regular case -o.

-O - tells wget where to put the output file and the second dash, - tells wget the output location is the screen. This complicated non semantic option specification makes wget behave the same as the default lynx. If you do not use the -O -, you have to specify a location for the retrieved file and make sure the location has the right permissions.

Linux and Unix have a waste bin named /dev/null. -O /dev/null tells wget to send the output to be discarded.

-q tells wget to be quiet and not produce messages.

-t 1 means retry once if the first request times out. The default without the t option is 20 retries. -t 0 can send wget into an infinite loop retrying if the requested URL is missing.

The result is:
wget -O /dev/null -q -t 1

Curl is installed by default in Ubuntu Linux. Use Curl in the following way.
curl ""

One Web site

cPanel can control many Web sites. If you only have one Web site, you can try this approach as suggested by Lamcraft. Instead of using the command, you can use the file path php /home/example/public_html/cron.php.

This approach works because there is only one Web site, one settings.php file, and one database. Drupal cron.php will default to that Web site. If you use Drupal multisite or the Domain module, cron will run for only the one site and you have to use the for all the other sites.

php tells Linux to run the specified file as a PHP command line execution (CLI mode). /example/ is the directory set up for your account. /public_html may be /www if your account is on Red Hat or Fedora Linux.

Developing cron jobs

Are you developing modules that use hook_cron() to perform work during cron jobs? You might be interested in the following notes.


Semiclean,, can reset the cron runtime date/time indicator Drupal uses to stop cron running multiple times.

Long running cron jobs

Poormanscron and the Drupal 7 equivalent run frequently. There is code to stop them running twice at the same time. Regular cron is safer because you can tell it to run just once every hour or day. What happens when you have to run one cron job every 5 minutes, perhaps a stock update, and another cron job runs once per day, perhaps a stock analysis, and lasts for 20 minutes?

Cron.php should run every 5 minutes until the long running cron job starts then cron should stop running new cron jobs until the long running job finishes. You miss out on the 5 minute stock updates until the 20 minute stock analysis is finished.

You could set up the long running job as a separate cron job. You could have sites/all/modules/stock_analysis/stock_analysis_cron_job.php as a separate job fired by a separate cron job in cPanel. You would write stock_analysis_cron_job.php in a similar way to writing Web services. The services module has documentation on writing services,, and an independent cron job is just a Drupal style Web service that does not need input.

Looking for support? Visit the forums, or join #drupal-support in IRC.


mcfilms’s picture

There are several step-by-step tutorials on how to configure cron on cpanel at:

A list of some of the Drupal sites I have designed and/or developed can be viewed at

ZeusTheMighty’s picture

/usr/bin/wget -O - -p it is on the status page

= SUCCESS!!!!!!

well, for me at least.

jefferis’s picture

Having a lot of trouble gettinig Drupal to recognize the cron job. The first time I ran it using

php /home/CPANELUSERNAME/public_html/cron.php
It worked, but not since over a week ago.

I've tried tons of variations:
/usr/bin/wget Produces:

--2011-03-10 14:44:01--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: `cron.php.3'

     0K                                                        0.00 =0s

2011-03-10 14:44:02 (0.00 B/s) - `cron.php.3' saved [0/0] 

While THIS: cd /home/CPANELUSERNAME/public_html/ ; php cron.php
OR THIS: php /home/CPANELUSERNAME/public_html/cron.php
Produce results like this:

 X-Powered-By: PHP/5.2.14
Set-Cookie: SESS7e627b1b0f6dfedc5a2c2a957cc35746=ae9e5acca6ead644fd2c5ec1d369aef4; expires=Sat, 02-Apr-2011 23:03:21 GMT; path=/
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Thu, 10 Mar 2011 19:30:01 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Content-Type: text/html; charset=utf-8

So it appears the cron jobs are working, just not registering with Drupal. I and the folks at Asmallorange are lost. I've tried a lot of other variations recommended, like curl silent and lynx but if they work, they don't produce anything else than the last results above.

Any help appreciated.

peterx’s picture

Does cron run when you enter in a browser? If not then look in the Drupal log and your Web server error log. The Lynx approach should produce exactly the same result because Lynx is just another browser visiting your Web site.

If the Web server access log shows cron.php was requested and ran, look for issues against cron.php in Drupal core. Cron.php was accessed but did nothing.

Cron.php produces a log entry in Drupal after a completed run. Do you get any cron messages in the Drupal log?

Do you have any modules that use cron? Are any of the modules new? A module might have faulty code that fails in the middle of cron.php. Cron.php does not put out a start message, only a completion message, and could fail without a message in the Drupal log. PHP error messages are usually in your Web server error log.

jefferis’s picture

I found out that a lot of the Cron Jobs appeared to be stuck. Running fixed the stalled cron jobs and let the simple

php /home/cPanelUsername/public_html/cron.php

worked just fine.

peterx’s picture

I added a reference note to the page.

Lamcraft’s picture

I installed Drupal 6 on a shared server at Bluehost and this is the same command I used:

php /home/cPanelUsername/public_html/cron.php

Just exchange cPanelUsername with your username and it should work fine.

I set it up to run every 5 minutes initially, just to test it, and then went back and edited it to run once a day.

peterx’s picture

Lamcraft, your approach is worth noting in case the comments are cleaned out.

TWD’s picture

I use the wget method to run Cron and it seems to work like this:

wget -O - -q -t 1

Works like a champ but I really have no idea what the variables mean
and cant find any resources that explain it.

So what do these mean:



peterx’s picture

-O - is the critical bit.

mapreferee’s picture

I added a cron job in Hostmonster cPAnel just by placing the command below:

* ----> Every Minute
* ----> Every Hour
* ----> Every Day
* ----> Every Month
* ----> Every Weekday
root wget -O /dev/null -q -t 1

Somehow it does not work. Any help appreciated.


p.s. I am trying to install the cloudfront module in drupal website.


peterx’s picture

Your cPanel cron should run the Drupal cron job. The cloudfront module should contain the Drupal hook_cron function implemented as cloudfront_cron(). The Drupal cron job then automatically runs the cloudfront cron code.

This is true for all Drupal modules. Drupal cron checks every module for a *_cron() function. Hook cron is documented in

Vallenwood’s picture

I'm running Drupal 7.14 on a CentOS/cPanel setup and here's what worked for me:

curl ""

Naturally, you replace "" with your site name and "key" with the key found in your Admin > Reports > Status Report. (Basically you just copy and paste that whole link under "Cron Maintenance tasks.")

pabobi’s picture

I used @Vallenwood's suggestion for curl in cPanel in Drupal 7. Worked great.

I don't know what version of Linux my shared host is using and don't have SSH/Terminal access set up yet, so I didn't want to spend time fiddling with absolute paths, etc. to lynx, wget, curl, etc. Luckily, my first try at curl with no path worked.’s picture

Running cron from the cpanel using PHP command does not work:
Here is the script I used:

php /home/boyddunl/public_html/ cron_key=mykeycode

The message I get back is "No input file specified."

Can you help?

Webserver: Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips DAV/2 mod_bwlimited/1.4
Drupal Version: 7.41