Zip but do not scan excluded folder

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I am making a zip of a directory.



I used this command to exclude a certain folder



zip -r myzip.zip /home/test -x share/*


When I used this command it still scans through that folder. It has numerous subfolders so I don't want it to waste time scanning through everything even though I excluded it. It also throws a lot of zip warning: name not matched because it has numerous symbolic links.



Is there a way to zip without scanning through everything each time?







share|improve this question



















  • The file structure has symbolic links everywhere in that folder. It causes it to loop infinitely when recursively going through that folder. Hence the need to exclude from the scan.
    – jimbob
    Jun 25 at 19:43










  • "I am making a zip of a directory." Does it have to be zip? Or would you accept "I am making a backup of a directory"? Native tools include tar or pax, and gzip or bzip2.
    – roaima
    Jun 25 at 21:01















up vote
2
down vote

favorite












I am making a zip of a directory.



I used this command to exclude a certain folder



zip -r myzip.zip /home/test -x share/*


When I used this command it still scans through that folder. It has numerous subfolders so I don't want it to waste time scanning through everything even though I excluded it. It also throws a lot of zip warning: name not matched because it has numerous symbolic links.



Is there a way to zip without scanning through everything each time?







share|improve this question



















  • The file structure has symbolic links everywhere in that folder. It causes it to loop infinitely when recursively going through that folder. Hence the need to exclude from the scan.
    – jimbob
    Jun 25 at 19:43










  • "I am making a zip of a directory." Does it have to be zip? Or would you accept "I am making a backup of a directory"? Native tools include tar or pax, and gzip or bzip2.
    – roaima
    Jun 25 at 21:01













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am making a zip of a directory.



I used this command to exclude a certain folder



zip -r myzip.zip /home/test -x share/*


When I used this command it still scans through that folder. It has numerous subfolders so I don't want it to waste time scanning through everything even though I excluded it. It also throws a lot of zip warning: name not matched because it has numerous symbolic links.



Is there a way to zip without scanning through everything each time?







share|improve this question











I am making a zip of a directory.



I used this command to exclude a certain folder



zip -r myzip.zip /home/test -x share/*


When I used this command it still scans through that folder. It has numerous subfolders so I don't want it to waste time scanning through everything even though I excluded it. It also throws a lot of zip warning: name not matched because it has numerous symbolic links.



Is there a way to zip without scanning through everything each time?









share|improve this question










share|improve this question




share|improve this question









asked Jun 25 at 19:25









jimbob

132




132











  • The file structure has symbolic links everywhere in that folder. It causes it to loop infinitely when recursively going through that folder. Hence the need to exclude from the scan.
    – jimbob
    Jun 25 at 19:43










  • "I am making a zip of a directory." Does it have to be zip? Or would you accept "I am making a backup of a directory"? Native tools include tar or pax, and gzip or bzip2.
    – roaima
    Jun 25 at 21:01

















  • The file structure has symbolic links everywhere in that folder. It causes it to loop infinitely when recursively going through that folder. Hence the need to exclude from the scan.
    – jimbob
    Jun 25 at 19:43










  • "I am making a zip of a directory." Does it have to be zip? Or would you accept "I am making a backup of a directory"? Native tools include tar or pax, and gzip or bzip2.
    – roaima
    Jun 25 at 21:01
















The file structure has symbolic links everywhere in that folder. It causes it to loop infinitely when recursively going through that folder. Hence the need to exclude from the scan.
– jimbob
Jun 25 at 19:43




The file structure has symbolic links everywhere in that folder. It causes it to loop infinitely when recursively going through that folder. Hence the need to exclude from the scan.
– jimbob
Jun 25 at 19:43












"I am making a zip of a directory." Does it have to be zip? Or would you accept "I am making a backup of a directory"? Native tools include tar or pax, and gzip or bzip2.
– roaima
Jun 25 at 21:01





"I am making a zip of a directory." Does it have to be zip? Or would you accept "I am making a backup of a directory"? Native tools include tar or pax, and gzip or bzip2.
– roaima
Jun 25 at 21:01











2 Answers
2






active

oldest

votes

















up vote
7
down vote



accepted










From man page:



-y
--symlinks



For UNIX and VMS (V8.3 and later), store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link. This can avoid multiple copies of files being included in the archive as zip recurses the directory trees and accesses files directly and by links.






share|improve this answer




























    up vote
    0
    down vote













    You will need to include the full path to the directory that you want to exclude. If it is inside of /home/test:



    zip -r myzip.zip /home/test -x /home/test/share/*


    If it's elsewhere:



    zip -r myzip.zip /home/test -x /home/test/path/to/share/*





    share|improve this answer





















      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      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%2f451832%2fzip-but-do-not-scan-excluded-folder%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      7
      down vote



      accepted










      From man page:



      -y
      --symlinks



      For UNIX and VMS (V8.3 and later), store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link. This can avoid multiple copies of files being included in the archive as zip recurses the directory trees and accesses files directly and by links.






      share|improve this answer

























        up vote
        7
        down vote



        accepted










        From man page:



        -y
        --symlinks



        For UNIX and VMS (V8.3 and later), store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link. This can avoid multiple copies of files being included in the archive as zip recurses the directory trees and accesses files directly and by links.






        share|improve this answer























          up vote
          7
          down vote



          accepted







          up vote
          7
          down vote



          accepted






          From man page:



          -y
          --symlinks



          For UNIX and VMS (V8.3 and later), store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link. This can avoid multiple copies of files being included in the archive as zip recurses the directory trees and accesses files directly and by links.






          share|improve this answer













          From man page:



          -y
          --symlinks



          For UNIX and VMS (V8.3 and later), store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link. This can avoid multiple copies of files being included in the archive as zip recurses the directory trees and accesses files directly and by links.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jun 25 at 20:02









          SivaPrasath

          3,88611737




          3,88611737






















              up vote
              0
              down vote













              You will need to include the full path to the directory that you want to exclude. If it is inside of /home/test:



              zip -r myzip.zip /home/test -x /home/test/share/*


              If it's elsewhere:



              zip -r myzip.zip /home/test -x /home/test/path/to/share/*





              share|improve this answer

























                up vote
                0
                down vote













                You will need to include the full path to the directory that you want to exclude. If it is inside of /home/test:



                zip -r myzip.zip /home/test -x /home/test/share/*


                If it's elsewhere:



                zip -r myzip.zip /home/test -x /home/test/path/to/share/*





                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  You will need to include the full path to the directory that you want to exclude. If it is inside of /home/test:



                  zip -r myzip.zip /home/test -x /home/test/share/*


                  If it's elsewhere:



                  zip -r myzip.zip /home/test -x /home/test/path/to/share/*





                  share|improve this answer













                  You will need to include the full path to the directory that you want to exclude. If it is inside of /home/test:



                  zip -r myzip.zip /home/test -x /home/test/share/*


                  If it's elsewhere:



                  zip -r myzip.zip /home/test -x /home/test/path/to/share/*






                  share|improve this answer













                  share|improve this answer



                  share|improve this answer











                  answered Jun 25 at 20:14









                  Nasir Riley

                  1,494138




                  1,494138






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451832%2fzip-but-do-not-scan-excluded-folder%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay