Posted By

chupzzz on 06/27/11


Tagged

cli drupal cron


Versions (?)

Drupal cron from PHP Cli


 / Published in: PHP
 

URL: http://dominiquedecooman.com/blog/how-run-drupal-cron-cli

Running php /path/to/your/site/cron.php will give an error. You need to create some php-file into root of your Drupal-site and put into it the code of this snippet. Then just add to your cronjob the full path to your php-script.

  1. <?php
  2. // $Id: cronlocal.php Exp $
  3.  
  4. /**
  5.  * @file
  6.  * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
  7.  */
  8.  
  9. $path='/home/ddcooman/workspace/extranet-client/src/drupal';
  10. chdir($path);
  11.  
  12. include_once './includes/bootstrap.inc';
  13. drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  14. drupal_cron_run();
  15. ?>

Report this snippet  

You need to login to post a comment.