One of the first steps to setting up a new Drupal site is to setup the regular Cron job. Hosting services vary in their support for cron and the usual methods (such as wget, curl etc). This post explores options to configure cron on a hosted server.
You can use a number of alternatives:
1) If your host allows you can use wget (CURL/LYNX etc) as per the guidelines (see http://drupal.org/cron) - but many hosts disallow that.
2) You can call Cron.php directly with PHP like
php -q /path/to/script.php (see http://blog.coderlab.us/2006/08/10/usrbinwget-permission-denied/)
So something like:
0 * * * * /usr/local/bin/php -q /home/username/public_html/cron.phpIf you get include errors like:
Warning: include_once(./includes/bootstrap.inc): failed to open stream: No such file or directory in /home/bluebagn/public_html/cron.php on line 9
Warning: include_once(): Failed opening './includes/bootstrap.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bluebagn/public_html/cron.php on line 9
Fatal error: Call to undefined function drupal_bootstrap() in /home/bluebagn/public_html/cron.php on line 10then create a special cron file (xcron.php) as per http://drupal.org/node/36678
<?php
$doc_root = dirname($_SERVER["SCRIPT_FILENAME"]);
chdir($doc_root);
include_once './cron.php';
?>and run that instead
3) Or of course use the excellant BBCron and list the sites to call cron for - especially good for local servers where you have loads of dev sites! ; )
4) The next step is to control access to cron so not everyone can call it