Exclude Directory Problem

BOFH
2009-07-29
2012-12-08
  • BOFH
    BOFH
    2009-07-29

    If my include file contains the following entry:

    Folder\SubFolder\

    I would expect

    D:\Folder\SubFolder\                           to be excluded
    D:\Folder\OtherFolder\SubFolder\    to be included

    but both are excluded?

    Thanks for your help

     
    • fernando
      fernando
      2009-07-29

      please clarify your query.
      show your command line.

      you state "include file" but expect its contents to be excluded.

       
      • fernando
        fernando
        2009-07-29

        $ :: Here is Directory structure:
        $ tree /a /f folder
        Folder PATH listing for volume Temps
        Volume serial number is ABCD-1234
        T:\TEST\FOLDER
        +---OtherFolder
        |   \---SubFolder
        |           exclude-me.dat
        |
        \---SubFolder
                include-me.dat

        $ :: Here is contents of include-list.txt:
        $ type include-list.txt
        Folder\SubFolder
        $ :: Here is example command line and output:
        $ 7za a archive -i@include-list.txt

        7-Zip (A) 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
        Scanning

        Creating archive archive.7z

        Compressing  Folder\SubFolder\include-me.dat

        Everything is Ok

        $ 7za t archive.7z

        7-Zip (A) 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03

        Processing archive: archive.7z

        Testing     Folder\SubFolder\include-me.dat
        Testing     Folder\SubFolder

        Everything is Ok

        Folders: 1
        Files: 1
        Size:       28
        Compressed: 211

        $

         
        • fernando
          fernando
          2009-07-29

          $ :: Here is Directory structure:
          $ tree /a /f folder
          Folder PATH listing for volume Temps
          Volume serial number is ABCD-1234
          T:\TEST\FOLDER
          +---OtherFolder
          |   \---SubFolder
          |           exclude-me.dat
          |
          \---SubFolder
                  include-me.dat

          $ :: Here is contents of exclude-list.txt:
          $ type exclude-list.txt
          *\OtherFolder
          $ :: Here is example command line and output:
          $ 7za a archive folder -x@exclude-list.txt

          7-Zip (A) 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
          Scanning

          Creating archive archive.7z

          Compressing  Folder\SubFolder\include-me.dat

          Everything is Ok

          $ 7za t archive.7z

          7-Zip (A) 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03

          Processing archive: archive.7z

          Testing     Folder\SubFolder\include-me.dat
          Testing     Folder\SubFolder
          Testing     Folder

          Everything is Ok

          Folders: 2
          Files: 1
          Size:       28
          Compressed: 219

          $

           
          • BOFH
            BOFH
            2009-08-05

            Is anybody out there to help me with this question?

             
            • Igor Pavlov
              Igor Pavlov
              2009-08-05

              Write full information about your problem again with details.

               
              • BOFH
                BOFH
                2009-08-05

                I have a problem with the exclude rule. I want to exclude a specific subdirectory of the root but it is then excluded in the whole directory tree.

                Here is the test setup:

                D:\>tree /a /f 7zipTest
                Folder PATH listing for volume AMS
                Volume serial number is D8E6-D2A0
                D:\7ZIPTEST
                +---OtherFolder
                | \---SubFolder
                | file_of_OtherFolder_SubFolder.txt
                |
                \---SubFolder
                file_of_SubFolder.txt

                $ :: Here is contents of exclude-list.txt:
                $ type exclude-list.txt
                7zipTest\SubFolder\
                *.tmp

                Meaning: I want to exclude a. the SubFolder only if it is a child of 7zipTest plus and b. all *.tmp files

                $ :: Here is example command line and output:

                7z.exe a d:\test.zip D:\7zipTest\ -xr@exclude-list.txt

                7-Zip 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03

                Scanning

                Updating archive d:\test.zip

                Everything is Ok

                I expect the file 7zipTest\OtherFolder\SubFolder\file_of_OtherFolder_SubFolder.txt to be zipped.

                I just realized that the problem only occurs if the recursive flag is on ( -xr )

                Thanks again for your help

                 
                • Igor Pavlov
                  Igor Pavlov
                  2009-08-05

                  7z.exe a d:\test.zip D:\7zipTest\  -x@x.txt  -xr@xr.txt

                  x.txt:
                  7zipTest\SubFolder\

                  xr.txt:
                  *.tmp

                   
                  • BOFH
                    BOFH
                    2009-08-05

                    Nice workaround. Thanks.

                    The current behaviour is quite dangerous, especially if 7zip is used as backup solution.

                    Do you consider this as a bug? If yes, I would be glad if you can fix it.

                     
                    • Igor Pavlov
                      Igor Pavlov
                      2009-08-05

                      There is no bug.
                      You want 3 things:
                      include 7zipTest\ exclude 7zipTest\SubFolder\
                      exclude *.txt in all subfolders (so you specify -r switch here).

                       
      • BOFH
        BOFH
        2009-07-30

        I try to be more precise:

        D:\>tree /a /f 7zipTest
        Folder PATH listing for volume AMS
        Volume serial number is D8E6-D2A0
        D:\7ZIPTEST
        +---OtherFolder
        |   \---SubFolder
        |           file_of_OtherFolder_SubFolder.txt
        |
        \---SubFolder
                file_of_SubFolder.txt

        $ :: Here is contents of exclude-list.txt:
        $ type exclude-list.txt
        7zipTest\SubFolder\

        Meaning: I want to exclude the SubFolder only if it is a child of 7zipTest...

        $ :: Here is example command line and output:

        7z.exe a d:\test.zip D:\7zipTest\ -xr@exclude-list.txt

        7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03

        Scanning

        Updating archive d:\test.zip

        Everything is Ok

        I expect the file 7zipTest\OtherFolder\SubFolder\file_of_OtherFolder_SubFolder.txt to be zipped.
        I just realized that the problem only occurs if the recursive flag is on ( -xr )

         
  • [JFX]
    [JFX]
    2009-10-10

    i have the same problem.

    i have:

    c:\doks

    with:

    c:\doks\dirtoexclude\withothersubdirs\a\b\c
    c:\doks\dirtoexclude\withothersubdirs\1\2\3
    c\doks\something

    and each directory listed here contains a bunch of files.

    i need to compress all the c:\doks dir, with subdirs and files but i have  to completely exlude the c:\doks\dirtoexclude with all subdirs and files contained.

    i can't (and don't want to) predict from what position i'll call 7za.

    i've prepared a filelist in c:\doks\something\filelist.txt that contains only a line:

    c:\doks\dirtoexclude

    and nothing else, for my test purpose.

    the commandline:

    7za a -r c:\doks\something\file-name c:\doks -xr@c:\doks\something\filelist.txt

    when i execute this, 7za matches a lot of files in subfolders of c:\doks\dirtoexclude … it seems to completely ignore my exclusion request.

    naturally if i use:

    7za a -r "c:\doks\something\file-name" "c:\doks" -xr@"c:\doks\something\filelist.txt"

    it's the same thing.

     
  • [JFX]
    [JFX]
    2009-10-12

    now I use a excellent workaround for all the cases:

        *subdirname*

    for all the lines.

    and if i have some extensions that i don't want ONLY in some subdirs i use:

        *someofthesubdirtext*.extension

    For **example**, i can create an exclude_file.txt to be used with an -xr@excludefile.txt switch, containing for example:

        *local\adobe*
        *local\Microsoft*
        *roaming\Microsoft*
        *temporary internet*
        *temp\*.exe

    … and this for sure works GREAT. In the above example i excluded three of the main space-consuming directories in a typical backup of a Vista user profile (obviously no Win.Mail backup was performed) , IE temporary internet files (all), and all the exe files found in typical temp directory…

    how the "-x" switch works is not a simple business to understand, imho. Maybe a bunch of example in the new help file of the commandline version will be welcome!  ;-)