Friday, July 31, 2009

Cobain Backup: Example of How to Exclude Directories Using Masks

Cobain Backup is a very useful file backup tool. I have been using it for years without any problems. In general it's easy to use. However, I find its mask syntax for excluding directories and all contents in those directories a little confusing. Here's some help.

Exclude masks (or include masks):
  • *\*svn\*\* - Exclude all subdirectories and files in them below any directory with a suffix of svn
  • *\*svn\* - Exclude any files in directories with svn as a suffix
  • *\*svn - Exclude empty directories with svn as its suffix
  • Note that slash direction is important
To exclude .svn directories and all files in them:
  • If empty directory pruning is enabled, two masks are required: *\*svn\*\* and *\*svn\*
  • Otherwise three masks are required: *\*svn\*\* and *\*svn\* and *\*svn