Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like get access to progress information from lftp. Currently, I'm using curl like so:

curl -o file -L 2> download.log

This writes curl's progress information to the download.log file, which I can tail to get real-time progress.

But the same approach doesn't work with lftp, either with stdout or stderr. I end up with an empty download.log file, until the transfer is complete.

lftp -e 'get;quit' 2> download.log
lftp -e 'get;quit' 1> download.log

When I don't redirect output, I see progress on the screen. When I do redirect output, I stop seeing progress on the screen, but nothing shows up in download.log. After the file transfer is complete, I see the final result, like this - but nothing before:

97618627 bytes transferred in 104 seconds (913.1K/s)

Is lftp doing something unusual with its output - printing to screen without printing to stdout/stderr? Are there other ways of capturing screen output than redirecting stdout/stderr?

share|improve this question
up vote 2 down vote accepted

It sounds to me like it's buffering its output. You might try the unbuffer expect script (man page).

share|improve this answer
That was exactly it. Thanks! – jondahl May 7 '10 at 18:54

Check the xfer domain variables :

set xfer:log 1

set xfer:eta-period 5 # every 5 seconds

set xfer:rate-period 20 # average rate

will put log transfer information into ~/.lftp/transfer_log

Not sure you can change the log file destination nevertheless

share|improve this answer

try thisto capture progress info: lftp sftp://$SFTPUSER:$SFTPPASS@$SFTPHOST -e "cd $DIRECTORY; mget $SFTPFILE; bye" > $SFTPLOG 2>&1

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.