0

I have a Feeds importer that's running periodically (with cron) using "Feeds Fetcher Directory" fetcher. Now I need to run the importer on demand from other app outside the site. Is there a way to just run the importer (not cron) in a similar way as cron does? (going to some url)

I'm using Drupal 7.53.

Thanks!

1

Since version 7.x-2.0-beta3, Feeds has Drush support. You could use the following command to trigger an import (where 'my_importer' is the machine name of your importer):

drush feeds-import my_importer

If the importer is attached to a content type, specify also the feed node with the option '--nid':

drush feeds-import my_importer --nid=2

Note that a source for the importer in question must exist*. So you need to have gone through the import form at least once.

You could write a shell script that executes the drush command and that is triggered when the url is requested.


*The drush command 'feeds-import' has more options, allowing you to perform an import even when no source was created yet. But I don't think that applies in your situation. See https://drushcommands.com/drush-7x/feeds/feeds-import for more information.

  • Thanks, it's a good option i didnt know about. Sadly in my case Drupal is running on Windows without drush. – Nacho Jan 19 '17 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.