I would like to use 7-zip to backup a directory, but I would like it to exclude all directories named ".svn" (anywhere in the source tree). Does anybody know if this is possible and in that case how?
|
feedback
|
|
To exclude all .svn directories you need to add the For example the following will create a backup of the
| |||||||||||
feedback
|
|
Instead of using 7-Zip to exclude the .svn (or potentially _svn) folders, I would recommend using the svn export command (use svn.exe from SlikSVN) to export the working copy to a temporary folder:
Then use 7-Zip as follows:
Then delete the staging folder. This is what I do to backup my local working copies. | ||||
|
feedback
|
|
You can exclude files with 7zip using a list of files or directories:
The exclude file looks like:
The key is the -xr and in particular the "r" which indicates apply the exclude list recursively, to each level of the directory. You may want to use 2 exclude file lists one for absolute and one for recursive exclusions. The above is from a bash script that runs in cygwin. | ||||
|
feedback
|
|
When I used
it ended up adding the .git directory which I didn't want, changing it to
got the desired result. | |||
|
feedback
|
|
When I used
the WEB-INF directory was not excluded. Adding an asterisk before the dir name
Got the desired result. | |||
|
feedback
|
|
For me, I was trying to backup a bunch of maven code directories and wanted to exclude any directory named "target":
Relevant exclude parameter was | |||
|
feedback
|
protected by studiohack♦ Aug 31 '11 at 6:02
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.