purga
purga

Reputation: 453

Rar command - ignore certain folders

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)?

Upvotes: 2

Views: 4373

Answers (7)

Mattias E
Mattias E

Reputation: 31

I tried the following and it worked for me:

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

Upvotes: 3

purga
purga

Reputation: 453

Using a batch file:

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.

Upvotes: 0

purga
purga

Reputation: 453

The final working version, three steps involved:

(1) dir /b /s /a .sv? > svn.lst 
(2) rar.exe a -r [archive name] . -xsvn.lst [email protected] 
(3) del svn.lst

Upvotes: 0

froes
froes

Reputation:

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

Upvotes: 0

Mark Sailes
Mark Sailes

Reputation: 1254

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

Upvotes: 1

MaxVT
MaxVT

Reputation: 13234

dir .svn /b /s > files.lst
rar (rest of command) [email protected]

Upvotes: 2

Igor Krivokon
Igor Krivokon

Reputation: 10275

Have you tried -x.svn*

Upvotes: 3

Related Questions