<div dir="ltr">2013/9/28 Johnny Rosenberg <span dir="ltr"><<a href="mailto:gurus.knugum@gmail.com" target="_blank">gurus.knugum@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div>So far I have almost never got any answers to anything I asked here, so here is the next exciting question:</div><div><br></div><div>I have a script that runs rsync for backup from my internal drive to an external one. It works great, but it would be nice to see the progress. It doesn't necessarily need to be based on file size, I just want to get some kind of hint what's going on.</div>
<div><br></div><div>So I searched around and ended up with something like this, just for testing if it works:</div><div><br></div><div>LineCount=$(find /Some/Folder | wc -l)</div><div>rsync -anuv /Some/Folder /media/Backup/AnotherFolder/ | pv -l -e -p -s ${LineCount}</div>
<div><br></div><div>(pv – Pipe Viewer – needs to be installed first: apt-get install pv)</div><div><br></div><div>What happens in my case is that all those lines from rsync are scrolling and the last line is:</div><div>[===================================================================================================================>] 100% <br>
</div><div><br></div><div>Not very useful information if you ask me.</div><div>I expected no lines scrolling from rsync, but only a ”progress bar” and the progress in % displayed. What am I missing?</div></div>
</blockquote><div><br></div><div>I think I found the answer myself in a video tutorial on YouTube…<br></div><div>I can just throw the output away:</div><div><div>LineCount=$(find /Some/Folder | wc -l)</div><div>rsync -anuv /Some/Folder /media/Backup/AnotherFolder/ | pv -l -e -p -s ${LineCount} > /dev/null</div>
<div><br></div><div>Then the 100% thing is all I see. It seems like it doesn't update very often, that's why I only see 100%. I tried rsync with a much bigger folder and now I got different numbers, and it seems like they are displayed every second or so.</div>
<div>Then I found pv's -i option:</div><div><br></div><div><div>LineCount=$(find /Some/Folder | wc -l)</div><div>rsync -anuv /Some/Folder /media/Backup/AnotherFolder/ | pv -l -e -p -s ${LineCount} -i 0.1 > /dev/null</div>
<div><br></div><div>Now the numbers appear ten times per second. Nice!</div><div><br></div><div><br></div><div>Johnny Rosenberg</div></div></div></div>