rsync subfolder to different folder nameUsing rsync to move (not copy) files between directories?rsync,...

Lead the way to this Literary Knight to its final “DESTINATION”

How can the US president give an order to a civilian?

Why is Skinner so awkward in Hot Fuzz?

Having some issue with notation in a Hilbert space

Class to generate a pdf invoice

Is swap gate equivalent to just exchanging the wire of the two qubits?

Basic power tool set for Home repair and simple projects

Leveraging cash for buying car

How "fast" does astronomical events happen?

What could be the physiological mechanism for a biological Geiger counter?

How do credit card companies know what type of business I'm paying for?

Redirecting output only on a successful command call

How to search for Android apps without ads?

Numerical second order differentiation

Digital signature that is only verifiable by one specific person

Leaving job close to major deadlines

Is there a term for someone whose preferred policies are a mix of Left and Right?

New Site Design!

Co-worker is now managing my team. Does this mean that I'm being demoted?

Does knowing the surface area of all faces uniquely determine a tetrahedron?

What do I put on my resume to make the company i'm applying to think i'm mature enough to handle a job?

Someone who is granted access to information but not expected to read it

Is it possible for underground bunkers on different continents to be connected?

Does anyone recognize these rockets, and their location?



rsync subfolder to different folder name


Using rsync to move (not copy) files between directories?rsync, delete files on receiving side that were deleted on sending side. (But don't delete everything)Apply given rsync exclude patterns on given directoryCan rsync be configured to avoid modifying subdirectories not found in the source folder?Rsync folder while --exclude-from'ing .gitignore files at different depthsrsync + chmod only selected filesHow does the --fuzzy option for rsync work?Can rsync copy directories over linksrsync --delete with superset destination folderHow to make rsync delete directories from destination that are not in the source list






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







0















When I do this:



rsync folder/a /mnt/some/destination


I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.



I know this is possible if I do this:



rsync folder/a/* /mnt/some/destination


However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.



A workaround would be to



cd folder/a && rsync --delete . /mnt/some/destination


Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.



Are there any options like the tar -C, or wget --cut-dirs?










share|improve this question





























    0















    When I do this:



    rsync folder/a /mnt/some/destination


    I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.



    I know this is possible if I do this:



    rsync folder/a/* /mnt/some/destination


    However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.



    A workaround would be to



    cd folder/a && rsync --delete . /mnt/some/destination


    Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.



    Are there any options like the tar -C, or wget --cut-dirs?










    share|improve this question

























      0












      0








      0








      When I do this:



      rsync folder/a /mnt/some/destination


      I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.



      I know this is possible if I do this:



      rsync folder/a/* /mnt/some/destination


      However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.



      A workaround would be to



      cd folder/a && rsync --delete . /mnt/some/destination


      Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.



      Are there any options like the tar -C, or wget --cut-dirs?










      share|improve this question














      When I do this:



      rsync folder/a /mnt/some/destination


      I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.



      I know this is possible if I do this:



      rsync folder/a/* /mnt/some/destination


      However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.



      A workaround would be to



      cd folder/a && rsync --delete . /mnt/some/destination


      Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.



      Are there any options like the tar -C, or wget --cut-dirs?







      rsync






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 47 mins ago









      SarkeSarke

      215125




      215125






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Instead of:



          rsync folder/a  /mnt/some/destination


          use:



          rsync folder/a/ /mnt/some/destination


          That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.






          share|improve this answer
























          • Ah, it's those little details! Thanks!

            – Sarke
            24 mins ago














          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%2f525052%2frsync-subfolder-to-different-folder-name%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Instead of:



          rsync folder/a  /mnt/some/destination


          use:



          rsync folder/a/ /mnt/some/destination


          That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.






          share|improve this answer
























          • Ah, it's those little details! Thanks!

            – Sarke
            24 mins ago


















          1














          Instead of:



          rsync folder/a  /mnt/some/destination


          use:



          rsync folder/a/ /mnt/some/destination


          That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.






          share|improve this answer
























          • Ah, it's those little details! Thanks!

            – Sarke
            24 mins ago
















          1












          1








          1







          Instead of:



          rsync folder/a  /mnt/some/destination


          use:



          rsync folder/a/ /mnt/some/destination


          That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.






          share|improve this answer













          Instead of:



          rsync folder/a  /mnt/some/destination


          use:



          rsync folder/a/ /mnt/some/destination


          That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 42 mins ago









          Jeff SchallerJeff Schaller

          46.9k1167152




          46.9k1167152













          • Ah, it's those little details! Thanks!

            – Sarke
            24 mins ago





















          • Ah, it's those little details! Thanks!

            – Sarke
            24 mins ago



















          Ah, it's those little details! Thanks!

          – Sarke
          24 mins ago







          Ah, it's those little details! Thanks!

          – Sarke
          24 mins ago




















          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%2f525052%2frsync-subfolder-to-different-folder-name%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

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...