Hi all,
I try to catch and save in a log file the output of LFTP using unbuffer, because seems impossible to get it via other ways, namely the usual > logfile.txt
Certainly the format shown in the shell is what I prefer because other dialogs (like using --log= or
xfer:log-file) don’t show the information about the progress so good as is shown in the shell.
Let me show you all the line I’m using …
unbuffer lftp -e “set ssl:verify-certificate no; set ftp:ssl-protect-data yes; set ftp:ssl-protect-list yes; mirror --reverse /path/to/send folder_to_receive_files ; quit” -u user@server.com,password ftp.server.com > mylog.log 2>&1
In the shell (I’m using Ubuntu) and using unbuffer I get the output well …
[code]mkdir folder_to_receive_files' [Connecting...] mkdir
folder_to_receive_files’ [Waiting for response…]
Transferring file OctoCod_1920x1080_Hitman.hevc.good.mp4'
OctoCod_1920x1080_Hitman.hevc.good.mp4’ at 0 (0%) [Waiting for response…]
OctoCod_1920x1080_Hitman.hevc.good.mp4' at 76744 (0%) [Sending data]
OctoCod_1920x1080_Hitman.hevc.good.mp4’ at 608160 (2%) 397.4K/s eta:58s [Sending data]
… etc …[/code]
BUT this is the problem!! …
Passing above set of LFTP commands through PHP exec, namely exec('unbuffer lftp -e "set ssl:verify-certificate no; set… etc, etc);
I cannot get the right dialog, but I get a cut version of the full dialog, like that …
mkdir `folder_to_receive_files' [Connecting...]
mkdir `folder_to_receive_files' [Waiting for response...]
`...d_1920x1080_Hitman.hevc.mp4' at 0 (0%) [Waiting for response...]
`...d_1920x1080_Hitman.hevc.mp4' at 125976 (0%) [Sending data]
`...d_1920x1080_Hitman.hevc.mp4' at 660288 (2%) 431.4K/s eta:63s [Sending data]
`...d_1920x1080_Hitman.hevc.mp4' at 1211976 (4%) 492.7K/s eta:54s [Sending data
`...d_1920x1080_Hitman.hevc.mp4' at 1785384 (6%) 579.6K/s eta:45s [Sending data
`...d_1920x1080_Hitman.hevc.mp4' at 2358792 (8%) 607.8K/s eta:42s [Sending data
`...d_1920x1080_Hitman.hevc.mp4' at 2932200 (10%) 619.6K/s eta:40s [Sending dat
`...d_1920x1080_Hitman.hevc.mp4' at 3505608 (12%) 639.3K/s eta:38s [Sending dat
`...d_1920x1080_Hitman.hevc.mp4' at 4079016 (14%) 634.0K/s eta:38s [Sending dat
It’s something strange and is making me crazy. I have been two full days fighting against this problem.
Anyone has some idea about what is happening?
Thank you very much in advance for your help.