According to the manpage of rar
rar a -r -x.DS_Store "rar file name" "folder"
should exclude .DS_Store from being packed into rar file. But it does not work.
I also tried:
rar a -r -x".DS_Store" "rar file name" "folder"
rar a -r -x"*/.DS_Store" "rar file name" "folder"
rar a -r -x"*.DS_Store" "rar file name" "folder"
None of them works.
OK, I got it.
rar a -r -x'*/.DS_Store' "rar file name" "folder"
will do the trick.