mediatribe.net -- Drupal and Web Development

Notice: this post was last updated 6 years 27 weeks ago so it might be outdated. Please be cautious before implementing any of suggestions herein.

Setting up Cron with Drupal 6 and cPanel

If you have a drupal site on a cPanel account, you can set up cron in cPanel. Here is how:

(1) Your site is, say, example.com
(2) Log into cPanel (example.com/cpanel)
(3) Go to cron jobs > standard
(4) Enter the following code in your cron:

/usr/bin/lynx -source http://example.com/cron.php

(replace example.com with your actual website)

I normally choose every hour, every day, every weekday, every month, and choose the minute corresponding to the current time. For example, if it is 8:23 a.m., I choose 23. This is because I have lots of sites on my server, and I don't want all crons to be called at the same time.

Power users can bypass the cPanel user interface and modify the cron directly with the following command in shell, substituting your cPanel username for "username":

$ crontab -e -u username

In the ensuing window, type in the following:

12 * * * * /usr/bin/lynx -source http://example.com/cron.php
31
* * * * /usr/bin/lynx -source http://example2.com/cron.php
59
* * * * /usr/bin/lynx -source http://example3.com/cron.php

If you get around to it the

If you get around to it the layout is pretty drab. Just a suggestion.

Hey, yes you are right, I

Hey, yes you are right, I agree 100%. In French we have a saying, "cordonnier mal chaussé" (the shoemaker has bad shoes). I'll get around to improving the layout someday.