Drupal Cron and Lunarpages

The one thing that didn't go smoothly in my install of Drupnewb.com on Lunarpages was the cron job. I've run cron manually a few times for DrupNewb, but now it's time to try and get this running correctly.

It seems that all you need to do is run the php program cron.php which is right in the root of Drupal. As I have previously set up cron jobs to optimize the MySQL tables for the custom CMS systems I have written, it wasn't too hard for me to get cron.php running for Drupal.

On the Lunarpages cPanel (if you have cPanel*) go into Cron jobs. Choose Unix style. Enter a minute and hour in those fields. As your command enter "php /home/drup19/public_html/cron.php", with your Lunarpages site name and number instead of drup19**. If you have installed Drupal in a directory other than your main html directory put that in the path after public_html/. Also, if you put your email address into the field "Please enter an email address where the cron output will be sent:" the system will do just that.

Once you set that up you will want to check in your Drupal site's admin panel under "admin >> logs >> recent log entries" after your cron job was to run to be certain that it did. You should see the message "Cron run completed" by user "Visitor".

*If you have your own server at Lunarpages you probably don't have cPanel. I have no idea what you do for that, but if you figure it out I'd love to hear about it.

**You can find your Lunarpages site name and number by looking in the "Critical Account info" email you received when you signed up. You can also find this number by going into "MySQL Databases" on cPanel and seeing what Lunarpages is appending to your Database or User name before the _. It should look like the first few letters in the name of your site and a one or two digit number.