How to show a progress bar for lftp script for newer version of lftp in 2020?
0
votes
0
answers
2999
views
I have read [this](https://unix.stackexchange.com/q/287186/29193) question and its answer, but they do not answer my question.
The shell script is this:
**My question is:** How can I get the progress bar to show the progress well?
Is there another CLI FTP client that shows the progress and is good for my requirements as seen in the lftp scripts shown above?
Thank you.
# Update 1
There are 2 remaining issues:
1. It would be great if I could show the progress of the operation relative to the total number of files that will be copied, not all the files available to be copied, because I use
let total=$(lftp -f lftp-script-count.txt | wc -l)-2
lftp -f lftp-script.txt |
while read word word2 filename
do
if [ "$word" = Transferring ]
then let count=count+1
let percent=count*100/total
echo -e "XXX\n$percent\nDownloading $filename\nXXX"
fi
done |
whiptail --title lftp --gauge progress 10 60 0
The **lftp-scrip-count.txt** lftp script works well:
debug 10
set ssl:verify-certificate no
open ...
user ... ...
cd ...
ls -R .
The **lftp-scrip-count.txt** lftp script works slow (but works for sure although I would love it to work faster) and the progress does not get to whiptail:
set ssl:verify-certificate no
open ...
user ...
cd ...
mirror -P=10 . lftp-works --exclude-glob=node_modules
quit
The result is that the progress bar is shown but remains at 0% till the end although it got to download the entire 251MB. If I resize the terminal window the whiptail screen does not get repainted.
When it reaches the end of the download, the progress bar window disappears well.
It seems to me that the procent shown by the simple lftp -f lftp-script.txt
is not global. The output of this command contains, besides the percent, things like this:
* Waiting for response...
* Receiving data/TLS
* Making data connection...
* Receiving data...
Example:

--only-newer
.
2. Keeping (1) in mind, it would be interesting to find out why with --only-newer
it has the same speed like without it, when the directory is already completely downloaded. If I could make the process faster it would be great.
Asked by silviubogan
(149 rep)
Mar 23, 2020, 06:28 AM
Last activity: Mar 23, 2020, 02:00 PM
Last activity: Mar 23, 2020, 02:00 PM