title: Monitoring Rsync Progress
body: <p>I'm trying to write a Python script which will monitor an rsync transfer, and provide a (rough) estimate of percentage progress. For my first attempt, I looked at an <code>rsync --progress</code> command and saw that it prints messages such as:</p>
  
  <pre>1614 100%    1.54MB/s    0:00:00 (xfer#5, to-check=4/10)</pre>
  
  <p>I wrote a parser for such messages, and used the to-check part to produce a percentage progress, here, this would be 60% complete.</p>
  
  <p>However, there are two flaws in this:</p>
  
  <ul>
  <li>In large transfers, the "numerator" of the to-check fraction doesn't seem to monotonically decrease, so the percentage completeness can jump backwards.</li>
  <li>Such a message is not printed for all files, meaning that the progress can jump forwards.</li>
  </ul>
  
  <p>I've had a look at other alternatives of messages to use, but haven't managed to find anything. Does anyone have any ideas?</p>
  
  <p>Thanks in advance!</p>