Matěj Zábský
Matěj Zábský

Reputation: 17272

Batch file: How to make * ignore ".svn" directories

I need to zip a large and deep directory tree with thousands of files on various levels of the tree.

The problem is that the whole tree is under SVN's version control. SVN has it's hidden metadata ".svn" directories in every dir, which inflates the size of the resulting ZIP by more than 100% (which is unacceptable since the resulting archive is purposed for online distribution).

Currently I'm using this:

7z -u archive.zip baseDir\*.png
7z -u archive.zip baseDir\*\*.png
7z -u archive.zip baseDir\*\*\*.png
7z -u archive.zip baseDir\*\*\*.png
7z -u archive.zip baseDir\*\*\*\*.png

...where the number of * levels is the maximum theoretical value of the tree. And all this is repeated for every extension that can possibly appear in the tree. This works - it builds the archive exactly as it should, but it takes far too long (a few minutes), since the whole tree has to be traversed many times.

And I want to make it faster, since I need to repeat this for every debug session.

Is there a more efficient way to select the "real" files in the directory tree?

Thanks for any help!

Upvotes: 2

Views: 1587

Answers (1)

Neil
Neil

Reputation: 55402

Try -xr!.svn

Stupid site won't recognise my answer because it was too simple...

Upvotes: 9

Related Questions