title: How to exclude directories with TAR on OSX?
body: <p>This is my current directory structure on my MacOSX-Machine:</p>
  
  <pre><code>kuli at fumpenwuppich in /volume/workspace on master [!?$]
  $ ls -l
  total 0
  drwxr-xr-x   4 kuli  staff  136 Nov 28 16:02 conf
  drwxr-xr-x   3 kuli  staff  102 Nov 28 16:23 html
  drwxr-xr-x   3 kuli  staff  102 Nov 28 13:06 legacy
  drwxr-xr-x  11 kuli  staff  374 Nov 28 15:41 vagrant.nginx
  </code></pre>
  
  <p>I want to create a tar.bz2-file as a backup, but without the sub directory '<strong>legacy</strong>'.</p>
  
  <p>I've tried multiple things:</p>
  
  <pre><code>tar cfjv --exclude 'legacy' ~/Dropbox/backup/kuli.20151128.tar.bz2 .
  tar cfjv --exclude='legacy' ~/Dropbox/backup/kuli.20151128.tar.bz2 .
  tar cfjv ~/Dropbox/backup/kuli.20151128.tar.bz2 --exclude legacy .
  tar cfjv ~/Dropbox/backup/kuli.20151128.tar.bz2 --exclude=legacy .
  tar cfjv ~/Dropbox/backup/kuli.20151128.tar.bz2 --exclude='legacy' .
  tar cfjv ~/Dropbox/backup/kuli.20151128.tar.bz2 --exclude './legacy' .
  tar cfjv ~/Dropbox/backup/kuli.20151128.tar.bz2 --exclude='./legacy' .
  tar cfjv ~/Dropbox/backup/kuli.20151128.tar.bz2 --exclude 'workspace/legacy' .
  </code></pre>
  
  <p>and so on. I've also tried to put the exlude-switch at the end of the command. </p>
  
  <p>But nothing worked. All commands ignore the exclude command at all.</p>
  
  <p>How to achieve this?</p>