I am using Ubuntu 12.04 as a repo and would like to view a progress bar when using rsync
from the command line. I tried the option suggested in this article (-P
), but I prefer to see a progress bar and not use Grsync. I am using rsync -P source dest
currently.
rsync has a
--info
option that can be used to not only output the current progress, but also the transfer rate and elapsed time:The explanation of how to use it comes under the
-P
option in the man page:So the following:
Results in the following being output and continuously updated:
Note that when the transfer starts the total number of chunks, and therefore the current progress, can change when the recursive option is used as more files are discovered for syncing
You can use
--progress
and--stats
parameters.How about this?
$rsync_param
Avoids double input of parameters
$(rsync "$rsync_param"n a/ b | awk 'NF' | wc -l)
Determines the number of steps to complete.
a/ b
a/
is the sourceb
is the targetIf your version of
rsync
does not accept the--info=progress2
option, you can usetqdm
:To install:
To use:
Yeah, do what Jon said: use the
--info=progress2
option. But, what do I do if my version of rsync is too old and doesn't support this option? Answer: upgrade rsync!Here's how to build
rsync
from source on Ubuntu(tested on Ubuntu 16.04)
Download latest version of rsync: https://download.samba.org/pub/rsync/src/. Ex: "rsync-3.1.3.tar.gz". Save it in a directory WITH NO SPACES AT ALL to ensure it builds right.
In your folder explorer, right-click it and go to "Extract Here".
Enter the extracted folder (ex: "rsync-3.1.3")
Right-click the screen in your folder manager and go to "Open in Terminal." Alternatively, do steps 2 through 4 manually on the command line. Ultimately you just need to be
cd
ed into this extracted directory containing thersync
source code.Check current version of
rsync
. Make note of this so you can see later it actually got updated.Install necessary tools:
Build:
Ensure it was updated:
Sample output:
Search the man pages for "progress2". You'll now have access to the
--info=progress2
option:...then press
/
key and typeprogress2
; press Enter to search for it; pressn
for the 'n'ext match until you find the entry you're looking for:Also see:
Partial References:
This finally worked:
Something I find useful is using a
tqdm
like this:Like @ostrokach said, you can install it either by
or
Set the params:
And invoke:
This will show overall progress counting files (actually - counting lines).
If you want to see the files being copied, you can omit the
--null
option from tqdm.