cron

Posted by: 
Dominique De Cooman

Use cron queues to store stuff that needs processing later on cron. This post provides a cron queue system to handle jobs in the background.

Drupal 7 cron

In Drupal 7 the cron.php requires a cron key that is auto-generated during the Drupal install.
http://foggyperspective.com/article/dont-forget-add-your-cron-key-drupal-7

Posted by: 
Dominique De Cooman

As discussed in previous blog post, drush cron can be run from crontab too. While seeming pretty straightforward, trying it out caused some troubles.

The thing you would do to make drush run from crontab is:

$ crontab -e
* * * * * drush -r /path/to/drupal

Also tried to give full path to drush install

$ crontab -e

Posted by: 
Dominique De Cooman

Running cron from cli in drupal will result in.

PHP Warning:  include_once(): Failed opening './includes/bootstrap.inc'

Running cron from cli is useful when your behind external authentication and crontab is not available over http. Because normaly you would put something like:

0 * * * * wget --spider <a href="http://yoursite/cron.php
">http://yoursite/cron.php [/geshifilter-codes]

Posted by: 
Dominique De Cooman

By big imports I mean creating millions of nodes and indexing them fo apache solr search. We needed to import 1 million records from file, 3 nodes for each record, one in each of our 3 languages. These nodes also had 3 taxonomy vocabularies, around 30 cck fields and we also needed to join another table containing a spatial coordinates for our geo field.

Posted by: 
Dominique De Cooman

In the command line type

crontab -e

Press your insert key.
Insert a line, run every five minutes for example (more on syntax http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5)
5 * * * * /usr/bin/lynx -source <a href="http://yoursite.com/cron.php
">http://yoursite.com/cron.php [/geshifilter-codes]

And now exit: press escape and type ":exit"
By exiting you are saving and you wont be prompted.

Subscribe to cron