How to redirect console output of ncftpget to log?

720 Views Asked by At

I would like to capture the progress information during downloads. I have tried, for example from a cmd prompt:

c:\Windows\ncftpget ftp://speedtest.tele2.net/1MB.zip > mylog
c:\Windows\ncftpget ftp://speedtest.tele2.net/1MB.zip >> mylog
c:\Windows\ncftpget ftp://speedtest.tele2.net/1MB.zip > mylog 2>&1

Mylog is always written with 0 bytes, unless the file to be downloaded is already present. In that case I get a 92 byte error message. The problem seems specific to ncftpget. It works with Windows 10 ftp.

1

There are 1 best solutions below

1
On

You need to use -d /path/to/log.txt

ncftpget -d /tmp/ncftpget.log <url>

Example output:

2018-12-01 03:49:33 Cmd: USER anonymous
2018-12-01 03:49:33 331: Password required for anonymous
2018-12-01 03:49:33 Cmd: PASS NcFTP@
2018-12-01 03:49:35 530: Login incorrect
2018-12-01 03:49:35 Cmd: QUIT
2018-12-01 03:49:35 221: Goodbye