You are here

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!

Comments

Thanks!

I was trying to figure out how to do this, as I am new to Drupal and Cron jobs. I am very glad you posted this. Thanks!

Tys man, I tried a few things but only curl worked with godaddy.

Troll,

I assume you mean using the following command in the cron manager

curl http://www.example.com/cron.php

That is working for me after a few others didn't.

Exactly the information I was looking for when I typed "godaddy drupal cron"

Sometimes google does work.

I typed the same exact thing...Google rocks!

Just what I was looking for.

Just like P in CO -- a quick Google search for "godaddy cron drupal" turned this up as the first result, and it worked like a charm. Thanks for the help! I appreciate it.

Great post. This was easy to follow and worked like a charm. Right on!

For the tip.

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!!

Just wanted to thank you for the info. I have been using the poormanscron and was a little intimidated by setting up cron jobs. You made it easy. THANKS!!!

easy enough once I found this page...

hats off to you ...:-)

r24mille's picture

I just wanted to thank everyone for leaving the notes of "thanks". I'm glad a short little article like this was able to help :)

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.

I am hosting my site on Godaddy server and satisfied with Cron manager but i want my script to run after every 15 minutes of an hour? This type of time customization is not provided in Cron manager.Can you please help me sort out this problem?

I was wondering for why my cron jobs would not work. Then I found this article. now the scheduler module should work on time now!

GOod stuff!

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.

r24mille's picture

I think you're right, 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.

https://hostingconnection.godaddy.com/Application/Drupal.aspx

I think I'll update the article with a note to that affect. So although the article is still valid for those who've done their own installations, if you're starting from scratch... using GoDaddy's easy button may be best :)

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 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!