How to copy files with certain extensions keeping the path from remote to local machine via scp --parents?Use...

How would photo IDs work for shapeshifters?

Does bootstrapped regression allow for inference?

Email Account under attack (really) - anything I can do?

Patience, young "Padovan"

Can a planet have a different gravitational pull depending on its location in orbit around its sun?

How many letters suffice to construct words with no repetition?

Is there a way to make member function NOT callable from constructor?

Is every set a filtered colimit of finite sets?

Check if two datetimes are between two others

aging parents with no investments

What to wear for invited talk in Canada

Why do UK politicians seemingly ignore opinion polls on Brexit?

Finding files for which a command fails

Why doesn't a const reference extend the life of a temporary object passed via a function?

Are cabin dividers used to "hide" the flex of the airplane?

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

How to move the player while also allowing forces to affect it

What are the advantages and disadvantages of running one shots compared to campaigns?

Why was the "bread communication" in the arena of Catching Fire left out in the movie?

Prime joint compound before latex paint?

Is this food a bread or a loaf?

Does the average primeness of natural numbers tend to zero?

Pristine Bit Checking

What's the difference between repeating elections every few years and repeating a referendum after a few years?



How to copy files with certain extensions keeping the path from remote to local machine via scp --parents?


Use scp to transfer a file from local directory X to remote directory Yscp (v4) copy from remote to multiple local filenamesUsing rsync to copy from local to remote server with cronjob, asking for passwordSCP from remote to local does not workHow to pipe scp/ssh file transfer(pull) through tar (remote->local transfer initiated from local machine)How to copy files from local datacenter to local datacenter and have some failover cases?How To dd or cp Entire Disk On Debian Remote Machine To Local Machine?How to copy files from a double remote server on a local machinescp to remote Windows hosts with spaces in path: ambiguous targetFail to scp file from remote to local






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I want to copy all *out from various subdirectories from my remote account to my local machine my trail is



scp --parents -r  @remote:~/path/*out .


this trail doesn't work
I am wondering about the mistake or if there any other alternative way to carry out this job










share|improve this question































    1















    I want to copy all *out from various subdirectories from my remote account to my local machine my trail is



    scp --parents -r  @remote:~/path/*out .


    this trail doesn't work
    I am wondering about the mistake or if there any other alternative way to carry out this job










    share|improve this question



























      1












      1








      1


      0






      I want to copy all *out from various subdirectories from my remote account to my local machine my trail is



      scp --parents -r  @remote:~/path/*out .


      this trail doesn't work
      I am wondering about the mistake or if there any other alternative way to carry out this job










      share|improve this question
















      I want to copy all *out from various subdirectories from my remote account to my local machine my trail is



      scp --parents -r  @remote:~/path/*out .


      this trail doesn't work
      I am wondering about the mistake or if there any other alternative way to carry out this job







      osx rsync scp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday









      Rui F Ribeiro

      42k1483142




      42k1483142










      asked Mar 30 at 22:56









      Mohsen El-TahawyMohsen El-Tahawy

      3121213




      3121213






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Try using rsync,



          rsync -rav  --include="*out" --include="*/" --exclude="*" user@remote:~/path .


          exclude everything, but
          include all *out files
          include subdirectores (needed to recurse)






          share|improve this answer
























          • it copy every *out file to the ./ directory but doesn't create the subdirectories

            – Mohsen El-Tahawy
            Mar 31 at 0:08











          • Are you by change adding a trailing / to user@remote:~/path? With rsync `~/path will copy path and all it's children (with -r), while ~/path/ will only copy it's children.

            – Fitz
            Mar 31 at 3:47











          • For security purposes and to remain congruent with the question, the -e ssh option should be added to rsync in order to utilize a secure connection.

            – RubberStamp
            Mar 31 at 12:08



















          1














          I believe that --parents arg is for cp. This works for me using a uname and full path:



          scp -r user@remote:/home/user/path/*out .






          share|improve this answer
























          • this copy all *out to the same directory, I need to copy and create the subdirectories also

            – Mohsen El-Tahawy
            Mar 31 at 0:09











          • Your right, checked again... The rsync -r that's mentioned above would do it.

            – ZarNix
            Mar 31 at 0:23














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f509666%2fhow-to-copy-files-with-certain-extensions-keeping-the-path-from-remote-to-local%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Try using rsync,



          rsync -rav  --include="*out" --include="*/" --exclude="*" user@remote:~/path .


          exclude everything, but
          include all *out files
          include subdirectores (needed to recurse)






          share|improve this answer
























          • it copy every *out file to the ./ directory but doesn't create the subdirectories

            – Mohsen El-Tahawy
            Mar 31 at 0:08











          • Are you by change adding a trailing / to user@remote:~/path? With rsync `~/path will copy path and all it's children (with -r), while ~/path/ will only copy it's children.

            – Fitz
            Mar 31 at 3:47











          • For security purposes and to remain congruent with the question, the -e ssh option should be added to rsync in order to utilize a secure connection.

            – RubberStamp
            Mar 31 at 12:08
















          2














          Try using rsync,



          rsync -rav  --include="*out" --include="*/" --exclude="*" user@remote:~/path .


          exclude everything, but
          include all *out files
          include subdirectores (needed to recurse)






          share|improve this answer
























          • it copy every *out file to the ./ directory but doesn't create the subdirectories

            – Mohsen El-Tahawy
            Mar 31 at 0:08











          • Are you by change adding a trailing / to user@remote:~/path? With rsync `~/path will copy path and all it's children (with -r), while ~/path/ will only copy it's children.

            – Fitz
            Mar 31 at 3:47











          • For security purposes and to remain congruent with the question, the -e ssh option should be added to rsync in order to utilize a secure connection.

            – RubberStamp
            Mar 31 at 12:08














          2












          2








          2







          Try using rsync,



          rsync -rav  --include="*out" --include="*/" --exclude="*" user@remote:~/path .


          exclude everything, but
          include all *out files
          include subdirectores (needed to recurse)






          share|improve this answer













          Try using rsync,



          rsync -rav  --include="*out" --include="*/" --exclude="*" user@remote:~/path .


          exclude everything, but
          include all *out files
          include subdirectores (needed to recurse)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 30 at 23:47









          FitzFitz

          3303




          3303













          • it copy every *out file to the ./ directory but doesn't create the subdirectories

            – Mohsen El-Tahawy
            Mar 31 at 0:08











          • Are you by change adding a trailing / to user@remote:~/path? With rsync `~/path will copy path and all it's children (with -r), while ~/path/ will only copy it's children.

            – Fitz
            Mar 31 at 3:47











          • For security purposes and to remain congruent with the question, the -e ssh option should be added to rsync in order to utilize a secure connection.

            – RubberStamp
            Mar 31 at 12:08



















          • it copy every *out file to the ./ directory but doesn't create the subdirectories

            – Mohsen El-Tahawy
            Mar 31 at 0:08











          • Are you by change adding a trailing / to user@remote:~/path? With rsync `~/path will copy path and all it's children (with -r), while ~/path/ will only copy it's children.

            – Fitz
            Mar 31 at 3:47











          • For security purposes and to remain congruent with the question, the -e ssh option should be added to rsync in order to utilize a secure connection.

            – RubberStamp
            Mar 31 at 12:08

















          it copy every *out file to the ./ directory but doesn't create the subdirectories

          – Mohsen El-Tahawy
          Mar 31 at 0:08





          it copy every *out file to the ./ directory but doesn't create the subdirectories

          – Mohsen El-Tahawy
          Mar 31 at 0:08













          Are you by change adding a trailing / to user@remote:~/path? With rsync `~/path will copy path and all it's children (with -r), while ~/path/ will only copy it's children.

          – Fitz
          Mar 31 at 3:47





          Are you by change adding a trailing / to user@remote:~/path? With rsync `~/path will copy path and all it's children (with -r), while ~/path/ will only copy it's children.

          – Fitz
          Mar 31 at 3:47













          For security purposes and to remain congruent with the question, the -e ssh option should be added to rsync in order to utilize a secure connection.

          – RubberStamp
          Mar 31 at 12:08





          For security purposes and to remain congruent with the question, the -e ssh option should be added to rsync in order to utilize a secure connection.

          – RubberStamp
          Mar 31 at 12:08













          1














          I believe that --parents arg is for cp. This works for me using a uname and full path:



          scp -r user@remote:/home/user/path/*out .






          share|improve this answer
























          • this copy all *out to the same directory, I need to copy and create the subdirectories also

            – Mohsen El-Tahawy
            Mar 31 at 0:09











          • Your right, checked again... The rsync -r that's mentioned above would do it.

            – ZarNix
            Mar 31 at 0:23


















          1














          I believe that --parents arg is for cp. This works for me using a uname and full path:



          scp -r user@remote:/home/user/path/*out .






          share|improve this answer
























          • this copy all *out to the same directory, I need to copy and create the subdirectories also

            – Mohsen El-Tahawy
            Mar 31 at 0:09











          • Your right, checked again... The rsync -r that's mentioned above would do it.

            – ZarNix
            Mar 31 at 0:23
















          1












          1








          1







          I believe that --parents arg is for cp. This works for me using a uname and full path:



          scp -r user@remote:/home/user/path/*out .






          share|improve this answer













          I believe that --parents arg is for cp. This works for me using a uname and full path:



          scp -r user@remote:/home/user/path/*out .







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 30 at 23:48









          ZarNixZarNix

          707




          707













          • this copy all *out to the same directory, I need to copy and create the subdirectories also

            – Mohsen El-Tahawy
            Mar 31 at 0:09











          • Your right, checked again... The rsync -r that's mentioned above would do it.

            – ZarNix
            Mar 31 at 0:23





















          • this copy all *out to the same directory, I need to copy and create the subdirectories also

            – Mohsen El-Tahawy
            Mar 31 at 0:09











          • Your right, checked again... The rsync -r that's mentioned above would do it.

            – ZarNix
            Mar 31 at 0:23



















          this copy all *out to the same directory, I need to copy and create the subdirectories also

          – Mohsen El-Tahawy
          Mar 31 at 0:09





          this copy all *out to the same directory, I need to copy and create the subdirectories also

          – Mohsen El-Tahawy
          Mar 31 at 0:09













          Your right, checked again... The rsync -r that's mentioned above would do it.

          – ZarNix
          Mar 31 at 0:23







          Your right, checked again... The rsync -r that's mentioned above would do it.

          – ZarNix
          Mar 31 at 0:23




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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%2funix.stackexchange.com%2fquestions%2f509666%2fhow-to-copy-files-with-certain-extensions-keeping-the-path-from-remote-to-local%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

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...