A simple wrapper for rsync that shows an improved progress bar
Rsync
is a fast, versatile, remote (and local) file-copying tool. There are two types of progress bars available for rsync
. You can view these bars by using either the --progress
or --info=progress2
arguments. None of them looks too good (subjective view). This script helps to display an improved progress bar. For this, you need to wrap rsync
command like this:
./rsync_wrapper -r "rsync ~/Documents/file.txt ~/Documents/file_copy.txt"
40.00% |█████████ | [El: 00:02; Rem: 00:03; ETA: 2023-06-16 10:01:02]
Processed: 0.10 GiB; Remaining: 0.14 GiB; Total: 0.24 GiB; Speed: 25.50 MiB/s.
File: Test.txt
- 1st: The progress bar with elapsed, remaining, and ETA times.
- 2nd: Size info, what shows transferred, remaining and total size of files. This row also shows the transfer speed.
- 3rd: Currently transferring file.
./rsync_wrapper.py --help
- -r (required): The
rsync
command between double quotes. This is the only required command. - -p (optional): If presented, progress bar will be hidden.
- -s (optional): If presented, size info will be hidden.
- -f (optional): If presented, file info will be hidden.
Run wrapper
and rsync
as normal user (You can copy only your own files):
./rsync_wrapper.py -r "rsync ~/Documents/file.txt ~/Documents/file_copy.txt"
Run wrapper
as normal user, but run rsync
as superuser (You can copy any files):
./rsync_wrapper.py -r "sudo rsync ~/Documents/file.txt ~/Documents/file_copy.txt"
Run wrapper
and rsync
as superuser (You can copy any files):
sudo ./rsync_wrapper.py -r "sudo rsync ~/Documents/file.txt ~/Documents/file_copy.txt"
Hide size info (-s
) and file info (-f
) lines:
./rsync_wrapper.py -fsr "rsync ~/Documents/file.txt ~/Documents/file_copy.txt"
Has been tested on Ubuntu v22.04
with Python v3.11
interpreter.