for loop serialization and waitFor loop with conditionsNewline in a for loopHow to work around Bash for loop...

Can elves maintain concentration in a trance?

The use of "touch" and "touch on" in context

Can anyone tell me why this program fails?

Is it possible that AIC = BIC?

Theorems like the Lovász Local Lemma?

Possible Leak In Concrete

Co-worker team leader wants to inject his friend's awful software into our development. What should I say to our common boss?

What is a good source for large tables on the properties of water?

Russian cases: A few examples, I'm really confused

Why are there 40 737 Max planes in flight when they have been grounded as not airworthy?

How do I hide Chekhov's Gun?

Make a transparent 448*448 image

How to simplify this time periods definition interface?

How to make healing in an exploration game interesting

Employee lack of ownership

Official degrees of earth’s rotation per day

Using "wallow" verb with object

Rules about breaking the rules. How do I do it well?

Does the statement `int val = (++i > ++j) ? ++i : ++j;` invoke undefined behavior?

Is it true that real estate prices mainly go up?

Connecting top and bottom SMD component pads using via

Schematic conventions for different supply rails

Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements

Pinhole Camera with Instant Film



for loop serialization and wait


For loop with conditionsNewline in a for loopHow to work around Bash for loop not exiting when a subcommand errors?Bash read within a while loop issuesimple loop not workinglist multiple file types in bash for loopfor loop (f in *.txt) throws error if no *.txt file existsFor Loop not printing the required resultLinux : double-quote variables and for file loopHow to get rid of spaces in sh for loop?













0















I need to copy over x amount of directories using aws's snowball client. However, since the client hogs quite a bit of resources, i'd like to serial each execution so that it runs 1 at a time and will wait for the previous copy to complete.



This is the script i have



#!/usr/bin/env bash

for d in $(find $PWD -mindepth 1 -maxdepth 1 -type d -name '20*' -not -name '2019-Q1');do

snowball cp -r --batchFileSizeInKBLimit=200000 --batchNumOfFiles=100000 ${d} s3://bucketname/dirname/$(basename ${d})"

done


how can I ensure the copy completes before the next one starts?
I am thinking 'wait $1' but idk if that will work here.









share







New contributor




romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I need to copy over x amount of directories using aws's snowball client. However, since the client hogs quite a bit of resources, i'd like to serial each execution so that it runs 1 at a time and will wait for the previous copy to complete.



    This is the script i have



    #!/usr/bin/env bash

    for d in $(find $PWD -mindepth 1 -maxdepth 1 -type d -name '20*' -not -name '2019-Q1');do

    snowball cp -r --batchFileSizeInKBLimit=200000 --batchNumOfFiles=100000 ${d} s3://bucketname/dirname/$(basename ${d})"

    done


    how can I ensure the copy completes before the next one starts?
    I am thinking 'wait $1' but idk if that will work here.









    share







    New contributor




    romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I need to copy over x amount of directories using aws's snowball client. However, since the client hogs quite a bit of resources, i'd like to serial each execution so that it runs 1 at a time and will wait for the previous copy to complete.



      This is the script i have



      #!/usr/bin/env bash

      for d in $(find $PWD -mindepth 1 -maxdepth 1 -type d -name '20*' -not -name '2019-Q1');do

      snowball cp -r --batchFileSizeInKBLimit=200000 --batchNumOfFiles=100000 ${d} s3://bucketname/dirname/$(basename ${d})"

      done


      how can I ensure the copy completes before the next one starts?
      I am thinking 'wait $1' but idk if that will work here.









      share







      New contributor




      romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I need to copy over x amount of directories using aws's snowball client. However, since the client hogs quite a bit of resources, i'd like to serial each execution so that it runs 1 at a time and will wait for the previous copy to complete.



      This is the script i have



      #!/usr/bin/env bash

      for d in $(find $PWD -mindepth 1 -maxdepth 1 -type d -name '20*' -not -name '2019-Q1');do

      snowball cp -r --batchFileSizeInKBLimit=200000 --batchNumOfFiles=100000 ${d} s3://bucketname/dirname/$(basename ${d})"

      done


      how can I ensure the copy completes before the next one starts?
      I am thinking 'wait $1' but idk if that will work here.







      bash-scripting





      share







      New contributor




      romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 mins ago









      romedawgromedawg

      1




      1




      New contributor




      romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      romedawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          romedawg is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1414140%2ffor-loop-serialization-and-wait%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          romedawg is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          romedawg is a new contributor. Be nice, and check out our Code of Conduct.













          romedawg is a new contributor. Be nice, and check out our Code of Conduct.












          romedawg is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1414140%2ffor-loop-serialization-and-wait%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...