title: Comprehensive list of rsync error codes
body: <p>I'm writing a script that does daily snapshots of users' home directories. First I do a dry run using:</p>
  
  <pre><code>rsync -azvrn --out-format="%M %f" source/dir dest/dir
  </code></pre>
  
  <p>and then the actual rsync operation (by removing the <code>-n</code> option).</p>
  
  <p>I'm trying to parse the output of the dry run. Specifically, I'm interested in learning the exact cause of the rsync error (if one occurred). Does anyone know of </p>
  
  <ol>
  <li>The most common rsync errors and their codes?</li>
  <li>A link to a comprehensive rsync error code page?</li>
  </ol>
  
  <p>Most importantly, rsync (at least on CentOs 5) does not return an error code. Rather it displays the errors internally and returns with 0. Like thus:</p>
  
  <pre><code>sending incremental file list
  rsync: link_stat "/data/users/gary/testdi" failed: No such file or directory (2)
  
  sent 18 bytes  received 12 bytes  60.00 bytes/sec
  total size is 0  speedup is 0.00 (DRY RUN)
  
  rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
  </code></pre>
  
  <p>Has anyone had to parse rsync errors and have a suggestion on how to store the rsync return state(s)? I believe, when transferring multiple files, that errors may be raised on a per file basis and are collected at the end as shown on the last line of code above.</p>