Problem: Ordering scheduled feeds imports

Events happening in the community are now at Drupal community events on www.drupal.org.
dbassendine's picture

Hi all,

As part of our open problem solving session at the Summer Lab on Tuesday, Rasheed raised an issue they had in regularly executing feeds import in a particular order.

In the session and afterwards, I picked up Bruce's suggestion of using a bash script that executes the imports using drush commands. The script would define the order the imports would be executed, only moving on to the next import if the previous one was successful. It would be fired at regular intervals using crontab, outside Drupal's scheduling queue.

Feeds does not provide drush commands by default, though there is quite a mature patch available (https://www.drupal.org/node/608408#comment-7747463). I tested this, and it works well to run imports using "drush feeds-import [feed]". You can also use "drush feeds-list" to show all available feeds, along with their machine names.

Any other suggested approaches, follow up or comments are welcome - please post below.

Hope this helps - David

Comments

Drush Feeds commands

dbassendine's picture

Here's some more detail on the commands available for Feeds in Drush, using the patch above. All the commands work well for me, with the exception of the --http option, which timed out even though the URL was good.

drush feeds-import [importer] - import a specific feed importer

  • options:
    • nid - node id of feeds importer to refresh (eg. --nid=2)
    • file - filepath of import data (eg. --file="[filepath]")
    • http - url of import data (eg. --http="[url]")
    • stdin - read import data from stdin (eg. --stdin)

drush feeds-import-all [importer] - import all instances of all importers - or import all instances of only the specific importer
drush feeds-clear [importer] - delete all imported content associated with this importer

drush feeds-list - list feed importers
drush feeds-list-all [importer]- list all instances of feed importers or list instances of a specific importer

drush feeds-enable [importer1] [importer2] - enable importers
drush feeds-disable [importer1] [importer2] - disable importers
drush feeds-revert [importer1] [importer2] - revert importers

Science on Drupal

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: