title: Update using rsync and remove from the source folder
body: <p>I want to <code>rsync</code> contents from <code>/local/path</code> to <code>server:/remote/path</code>.</p>
  
  <ul>
  <li><p>The files end with extensions composed by 4 digits</p></li>
  <li><p>If a file does not exist in remote path, copy the file to remote and remove from local</p></li>
  <li><p>If a file exists in remote path and the size is no less than the local one, do not copy the file to remote and remove it from local</p></li>
  </ul>
  
  <p>I tried</p>
  
  <pre><code>rsync -avmhP --include='*.[0-9][0-9][0-9][0-9]' --include='*/' --exclude='*' --size-only --remove-source-files /local/path server:/remote/path
  </code></pre>
  
  <p>However, some files existing in the remote path remain in local path.</p>
  
  <p>Another question is, why we need <code>--include='*/' --exclude='*'</code>? Why <code>--include='*.[0-9][0-9][0-9][0-9]'</code> alone doesn't work for the file filtering?</p>