Saturday, September 8, 2007

Drupal cron job setups on SiteGround

The purpose of this post is to save failed attempts at getting this working.

ATTEMPT 1a/1b
/usr/local/bin/php /home/username/public_html/cron.php
/usr/bin/php /home/username/public_html/cron.php

both result in this error:
Warning: main(./includes/bootstrap.inc): failed to open stream: No such file or directory in /home/username/public_html/cron.php on line 9

Warning: main(): Failed opening './includes/bootstrap.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username/public_html/cron.php on line 9

Fatal error: Call to undefined function drupal_bootstrap() in /home/username/public_html/cron.php on line 10

This post indicates you can't get to it via command line php and says to go wget route:
http://drupal.org/node/153247

ATTEMPT 2 - WGET
wget -O - -q http://www.mydomain.net/cron.php
/usr/bin/wget -O - -q http://www..com/cron.php -U "Mozilla/4.0"

neither appeared to run - they did not send a notification either

this one works for me:
wget -O - http://www.mydomain.net/cron.php

3 comments:

Rory McPherson said...

Thanks - this really helped me - I just upgraded to 5.7 and cron wasn't working (it was on 5.2) - now it is ... thanks mate!

Unknown said...

I use siteground for several drupal sites on siteground. I haven't come across the place where i can put this command. I imagine it is somewhere in the cpanel set up?

wget -O - http://www.mydomain.net/cron.php estion but where do you

Francisco Arriaga said...

Thanks a lot pal! I was looking for some help, and nothing works until the last command you published.

Now i'm able to run cron jobs automatically in my drupal site!

Well done!