Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

Rsync progress display during transfer
https://forum.ivorde.com/rsync-progress-display-during-transfer-t19779.html
Page 1 of 1

Author:  mandrei99 [ Tue Mar 03, 2015 8:24 am ]
Post subject:  Rsync progress display during transfer

Rsync is a powerful tool to transfer files from one server to another or from one directory to another. To enable progress display while you transfer a file use the --progress switch (double dash).
Quote:
--progress show progress during transfer



Example how to use rsync progress display


Code:
$ rsync --progress source:/tmp/file .
file
      2,359,296   0%    1.07MB/s    0:14:39 


---------
Syncronizing directories from a remote directory to local directory or vice-versa can be done using rsync.

Be default, rsync doesn't show a progress bar while transfering files.

Rsync with progress bar
Use the below syntax in order for rsync to display a progress bar:

Code:
$ rsync -r -v --progress -e ssh root@remote-server:~/pictures /home/user/
receiving file list ...
366 files to consider
pictures/IMG_1141.jpg
      3849245 100%   32.30kB/s    0:01:56 (xfer#30, to-check=335/366)
pictures/IMG_1142.jpg
     4400662 100%   32.21kB/s    0:02:13 (xfer#31, to-check=334/366)
pictures/IMG_1172.jpg
     2457600  71%   32.49kB/s    0:00:29

in this case rsync used some arguments:
Quote:
-r, --recursive recurse into directories
-v, --verbose increase verbosity
-e, --rsh=COMMAND specify the remote shell to use (which in my case it was ssh)
--progress show progress during transfer


So basically, put --progress after your rsync command or you can create an alias like this:

Code:
$ alias rsync='rsync --progress'
$ alias rsync
alias rsync='rsync --progress'

You can add this alias to your ~/.profile and everytime you will be using rsync command, the progress bar will be shown durring file transfer.

Author:  mandrei99 [ Tue Mar 03, 2015 8:31 am ]
Post subject:  Re: Rsync progress display during transfer

Code:
alias copyfolder='rsync --progress -r'
to make an alias that will copy a folder recursively and display the transfer progress.

Author:  mandrei99 [ Tue Mar 03, 2015 8:39 am ]
Post subject:  Re: Rsync progress display during transfer

bash "reset" command can also be used to clear the screen.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/