Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Thu Dec 07, 2023 7:49 am


System administration, processes administration, jobs, cron, resources, limits, shells, ssh, telnet.

Author Message
mandrei99
Post  Post subject: Rsync progress display during transfer  |  Posted: Tue Mar 03, 2015 8:24 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

Offline
 

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.





Top
mandrei99
Post  Post subject: Re: Rsync progress display during transfer  |  Posted: Tue Mar 03, 2015 8:31 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

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


Top
mandrei99
Post  Post subject: Re: Rsync progress display during transfer  |  Posted: Tue Mar 03, 2015 8:39 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

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


Top
Display posts from previous:  Sort by  
E-mail friendPrint view
Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO