Feeds Not Importing During Cron Run

Drush can be used to run Feeds import jobs on Drupal cron when setting 'Periodic import' doesn't run the import.

While Feeds is an awesome Drupal module for importing data, it doesn't always work as advertised. One such shortcoming is running imports on cron.

I created a Feeds Importer and set 'Periodic import' to 'As often as possible'; however, now matter how many times I ran cron, the import job was never run. There is an open issue on Drupal.org on the subject (http://drupal.org/node/1553190); however, there is currently no consensus on the proposed patches.

Use a Separate Drush Cron Job

An alternative is create a separate cron job, which runs a drush feeds command separate from Drupal cron.

Drush integration hasn't been committed to Feeds yet (http://drupal.org/node/608408); however, it is available as a patch. The patch creates a new file, feeds.drush.inc, so there isn't the risk of modifying the module code itself. A link to the patch I am using can be found below:

http://drupal.org/files/608408-feeds_drush_vd7-71.patch

Below is an example of a cron task that will run the import 'import_name' every 15 minutes:

*/15 * * * * drush feeds-import import_name --root=/var/www/example.com -l example.com

For more information about crontab, see http://linux.die.net/man/1/crontab

Add new comment