Running Drupal cron jobs on GoDaddy hosting

05/31/2010 Update: Between the time I originally posted this article and now, Drupal has continued to grow in popularity and GoDaddy's drop-in applications are super-easy. Although the article is still valid for those who've done their own installations, if you're starting from scratch then using the drop-in applications may be easiest.

Running Drupal's cron.php in GoDaddyI [heart] Drupal. And for those of you interested in aggregating content, you know that Drupal needs a regular cron job (a scheduled task) to update your aggregated items. The easiest way to do this is schedule a curl http://www.yoursite.com/cron.php All Drupal sites have that cron.php file by default and when you run it, any cron jobs configured in your Drupal project will be run.

I do my hosting for my sites with GoDaddy.com. They provide me with all the options I need doing a basic website setup:

  • Choice between php4 and php5.
  • Choice between MySQL 4 and MySQL 5.
  • The ability to run cron jobs.
  • Decent limits and all that jazz.
  • Very little downtime, even on my basic accounts

In case you're wondering... I listed of all that simply because I'm a happy customer. Anyways, our topic on hand is setting up a cron job through their interface.

Log in and go to My Account -> Hosting and Email -> Web Hosting and Databases -> and open your Web Hosting control panel. Once in the control panel go to Content -> Cron Manager. You'll be presented with a screen similar to the screenshot above. To set up your job:

  1. Hit "Create Cron Job" in the upper right-hand corner.
  2. You'll see 4 fields. Name your job whatever you'd like.
  3. The command should be this: curl http://www.yoursite.com/cron.php (No quotes, and don't use the Browse button)
  4. Set your Frequency and Hour to what you'd like.
  5. Hit Save and it should be listed below.

Shabam! Your Drupal cron jobs will now be run on a regular schedule. That was easy!

23 Comments

Worst hosting service provider = Godaddy

The worst website hosting is Godaddy. Their hosting services are the complete opposite of their registrar services. They have very unusual restrictions in plans (like a limit of 1000 e-mails sent per day in a DEDICATED SERVER, lol). These restrictions are hidden in it's "sales technics". The support is very slow, take more than 24 hours to answer questions. No guarantee, no refundable, no respect, no shame to provice a deficient service. They win money with it's hosting services lying to customers. It's probabbly an outsourced service. Terrible. Flee from its host services!!

Oh, dear, is that

Oh, dear, is that it?
Godaddy.com's help says things like putting "/web/cgi-bin/php" at the beginning of the command line and I never get it working! "Curl" is much simpler. Hope it can do the trick. Thank you very much.

GoDaddy is making it even easier

I just set up a Drupal site on my GoDaddy account. At the top of the Hosting Control Center they now have a button called "Your Applications." One of the applications you can choose to install is Drupal. At the time of this writing, Drupal 6.10 was available, but GoDaddy only had 6.9 set up. Be that as it may, I went ahead and installed it.

GoDaddy automatically built my Drupal site in the directory I specified, set up my MySQL database and even scheduled an hourly cron job for me. I upgraded to Drupal 6.10 simply by getting the whole site down to my local, winmerging a copy of 6.10 with the 6.9 version from GoDaddy, and uploading only the files that were modified (if you've never heard of WinMerge, you might want to grab it...free software...great for seeing the differences between two files, or even all the files in two directories, including the contents of subdirectories).

So anyway, if you are just about to install a Drupal site, GoDaddy can do a lot of the work for you.

cron jobs - customer service told me...

For anyone who can't get their cron jobs to work in PHP or PHP5.

If you are on a linux shared hosting 2.0 account you must wait until 1AM california time for thier servers to restart before your cron jobs will become active. Even if you hit the "enable" button.

Instructions: use the "browse" button to navigate to the script you want to execute and let godaddy enter the command automatically. save the cron job, then select it and hit "enable." Then wait until 1AM california time. If all goes well your cron job should run, and be active after that.

I think this worked, except

I think this worked, except that I needed to uncomment the RewriteBase line in .htaccess to get clean URLs. Since I run a number of Drupal 5&6 sites on godaddy.com, I took a look and it seems that half have the line uncommented, half don't, all have pretty URLs. Go figure.This information that you have shared with us is excellent, I'm glad i came to this site, Once again thank you!