title: rsync: how to replicate full directory structure
body: <p>I would like to use rsync to sync some directories from a remote server to my local machine. In order to keep the files organized i would like rsync to create/copy the whole path with all the parent directories.</p>
  
  <p>I am using ssh with certificate files so no manual login is required.</p>
  
  <p>If i use it like following it copies the file.crt but does not create the parent directories:</p>
  
  <pre><code>rsync -ave ssh user1@10.10.10.10:/opt/dir/data/file.crt /home/user1/
  </code></pre>
  
  <p>If i try to use the -R --recursive option it fails with the error below: </p>
  
  <pre><code> rsync -ave --recurisive ssh user1@10.10.10.10:/opt/dir/data/file.crt /home/user1/
  </code></pre>
  
  <p>or with -R</p>
  
  <pre><code> rsync -aveR ssh user1@10.10.10.10:/opt/dir/data/file.crt /home/user1/
  </code></pre>
  
  <blockquote>
    <p>Unexpected remote arg: user1@10.10.10.10:/opt/dir/data/file.crt</p>
    
    <p>rsync error: syntax or usage error (code 1) at main.c(1361) [sender=3.1.2]</p>
  </blockquote>
  
  <p>Thanks for any help in advance</p>