title: Copying files and dirs on remote server while excluding some of them
body: <p>Server 1 is connected to Server 2 via SSH.</p>
  
  <p>We know this:
  I can execute a command such as </p>
  
  <p>"  ssh server2 "cp -rv /var/www /tmp"  "</p>
  
  <p>which will copy the entire /var/www dir to /tmp.  However inside of /var/www we have the following structure(sample LS output below)</p>
  
  <p>$ ls<p>
  /web1
  /web2
  /web3
  file1.php
  file2.php
  file3.php</p>
  
  <p>How can I execute a cp command that will exclude /web1, /web3, file1.php and file3.php  (obviously just copying web2 and file2 is not an option since there are significantly more files than just 6)</p>
  
  <p>Note: I am using this to backup Server2 prior to RSYNCing from Server1.</p>