Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I notice that the drush documentation includes a batch-process
command, but I haven't been able to figure out how to use it. Does drush support the Batch API? If so, how can I set and process a predefined batch job using drush? (Drupal 6.17)
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedThere are no docs at this time. The updatedb command is the only core command to use drush's implementation of batch api. Study it for guidance. Its a bit complex, unfortunately.
Comment #3
domidc CreditAttribution: domidc commentedI tried looking at the updatedb command but I couldnt make it work.
I have this drush command building up a batch
It creates the batch in the databse, but when it gets to drush_backend_batch_process() it doesnt execute the batch.
In batch_6.inc I checked if the correct id is submitted and it is.
I have no idea what I m doing wrong at this point, wouldnt this be like typing: "drush batch-process 5". (btw I tried that and that works)
Can you give me a clue please? Thanks in advance.
Comment #4
domidc CreditAttribution: domidc commentedIt must have been something with the windows drush. I tried it on a linux machine and everything works. Still dont know what the cause is, but since production will be on a linux machine its not an issue for me anymore.
Comment #5
xjmThanks for the snippet! I got lost trying to follow updatedb. I'll try this as a template and maybe post a handbook page if I can get it working.
Comment #6
xjmI was able to use #3 to create working batch jobs. I created a handbook page based on this issue at: http://drupal.org/node/873132. Feel free to insert any corrections.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedAwesome work, xjm. Thanks.
Comment #10
greg.1.anderson CreditAttribution: greg.1.anderson commentedDeleted some spam that changed the title of this issue. Should have recovered the title first, it appears.