exclude ~$ names from archiving by 7za

0

Im trying exclude some temp files from archive, but

-x!*\~$*

not working. Can you fix me, please?

Full command, which I use:

7za a -ssw -mx9 -xr!?git\* -x!*\~$* "...\asdasd.7z"  "C:\...\folder"

qwerty

Posted 2013-08-22T08:23:53.167

Reputation: 3

Answers

0

You have to use -xr rather than just -x to tell 7z that the excluded files are in a subdirectory. You have taken -xr for the git tree.

If delayed expansion of environment variables is active in your script, you have to escape the !. Write ^^! instead.

Example:

7z a -r -ssw -mx9 -xr!"~$*" c:\target\xxx.7z c:\myfolder\*.*

Axel Kemper

Posted 2013-08-22T08:23:53.167

Reputation: 2 892

I have unnecessary files from ||7za a -ssw -mx9 -x!~$ "asdasd.7z" "folder"|| in archive. It's temporary msword files.. ||Compressing some_folder\some~$some_file.docx|| How exclude it? – qwerty – 2013-08-22T12:12:58.773

See my example above. I am using 7z.exe rather than 7za.exe. Note the extra quotes and the wildcards. – Axel Kemper – 2013-08-22T12:35:29.687

Its working, thx – qwerty – 2013-08-23T08:46:03.083