2

I am trying to tranfer multiple file using lftp 4.4.8 on a centos 7 machine, on a daily basis.

For the purpose of monitoring this workflow, I would like to log transferred file into 2 groups (first and second). So I change the log file address in the middle of transfer script, using set xfer:logfile mysecond.txt.

Here is the script:

#!/bin/bash

lftp $HOST -u $USER,$PASSWORD <<EOF

set xfer:log true
set xfer:log-file myfirst.log

lcd /local/path/first

cd /remote/path/first

put file-first.txt
put file-first2.txt

lcd /local/path/second
set xfer:log-file mysecond.log

cd /remote/path/second

put file-second.txt
put file-second2.txt

bye
EOF

But the result is not as expected. All transferred file (including file-second.txt and file-second2.txt) are logged into the first log file (myfirst.log). Looks like lftp does not recognize changing the log file in the following line:

set xfer:log-file mysecond.log

Am I missing something? How can I achieve what I intend?

Many thanks.

  • 1
    i think it is an issue, you may search in https://github.com/lavv17/lftp/issues – Oliver Gaida Oct 20 '20 at 06:53
  • 1
    Changing the log file works for me with lftp version 4.8.4 and Ubuntu 20.04. – Cyrus Oct 20 '20 at 07:32
  • Thanks @OliverGaida. I already did, and created as [issue](https://github.com/lavv17/lftp/issues/607) myself since couldn't find anything in previous ones. – Majid Pourkashani Oct 21 '20 at 13:55
  • Thanks @Cyrus, I thought so. Unfortunately the latest packaged version for Centos 7 is 4.4.8, and I am trying to avoid the hassle of installing from source, etc. – Majid Pourkashani Oct 21 '20 at 13:59
  • 1
    I have just tested it with lftp version 4.4.8 and RHEL 7. I can confirm that it does not work with this version. – Cyrus Oct 21 '20 at 14:28

0 Answers0