I have read this question and its answer, but they do not answer my question.
The shell script is this:
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...
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?
There are 2 remaining issues:
- 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
- Keeping (1) in mind, it would be interesting to find out why with
--only-newerit 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.