tags:

views:

278

answers:

6

I would like to rar a folder but exclude a certain of folders and all the files beneath them - the .svn folder.

How could I make this happen using the rar console command (rar.exe)?

+2  A: 

Have you tried -x.svn*

Igor Krivokon
Wow. I've been trying through all those options and just can't figure it out. Thanks for the help.
This is not working. Files beneath the .svn folders will still get archived.
This will work with some tiny tweakings :)
+1  A: 
dir .svn /b /s > files.lst
rar (rest of command) [email protected]
MaxVT
This will only work for the top level, but not the sub folders.
A: 

The final working version, three steps involved:

1) dir /b /s /a .sv? > svn.lst
2) for /f \"tokens=* delims=\" %%i in ('dir /s /b /a:d *svn') do (dir /b /s /q \"%i\") >> svn.lst
3) rar a [email protected] myarchive [files....]

These three lines has to be in a .bat file.

+2  A: 

You could do an svn export, then you wouldn't have the .svn folders in the first place.

Mark Sailes
It seems so obvious, why did no-one think of this before?
James Camfield
A: 

You have to include the fully qualified path and it's substructures. The path has to be canonical.

popdir %mypath%\.svn
set _=%cd%
pushdir

rar a -x%_% -x%_%\* myarchive
A: 

I tried the following and it worked for me:

RAR a -ehs -x*.svn* -r

Mattias E