title: How do I exclude directories from an rsync that exist on both servers?
body: <p>Here's my file structure:</p>
  
  <pre><code>Server_A                  Server_B
  ==============            ==============
  /path/dir1/               /path/dir1/
             logA.txt                  logA.txt
             logB.txt                  logB.txt
  /path/dir2/               /path/dir2/
             fileC.txt                 fileC.txt
             fileD.txt                 fileC.txt
  </code></pre>
  
  <p>I need to rsync path/dir2 from server A to B, but not path/dir1.</p>
  
  <p>My rsync command looks like this:</p>
  
  <pre><code>rsync -arv --exclude '/dir1' /path/ root@server_b:/path
  </code></pre>
  
  <p>But every time I run it the result shows dir1 in the print out:</p>
  
  <pre><code>sending incremental file list
  ./
  dir1/
  dir1/logA.txt
  dir1/logB.txt
  sent 52147 bytes  received 23342 bytes  14405.50 bytes/sec
  total size is 215619123  speedup is 2851.02
  </code></pre>
  
  <p>What am I missing?</p>