RAR command line – to exclude files and folders

by admin on July 30, 2010 · 0 comments

After many try&fail, I finally figured how to exclude files and subfolders when archiving with RAR command line.
Basically I tried to archive a folder with .svn subfolders. I definitely want to exclude them from the archive. But when I tried:

rar a -r -x.svn myarchive

It did not exclude any .svn folders in second or deeper level of folder hierarchy.
Now the correct way is:

rar a -r  -x.svn -x*/.svn -x*/.svn/* -x*/anotherSubFolder -x*/anotherSubFolder/* myarchive

It will exclude all folder and subfolders with name .svn or anotherSubFolder.
Happy Year 2009!

Previous post:

Next post: