bash lftp 的日志位置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14250975/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 04:13:31  来源:igfitidea点击:

Logging location of lftp

linuxbashlogginglftp

提问by Wei

While using lftp, it will log the file transfer to the ~/.lftp/transfer_log when xfer:log setting is set to "yes".

使用 lftp 时,当 xfer:log 设置为“yes”时,它会将文件传输记录到 ~/.lftp/transfer_log。

What will happen when there are two instances of lftp running at the same time? Will the log file be mixed up?

当有两个 lftp 实例同时运行时会发生什么?日志文件会混淆吗?

Is there a way to change where the log file will be write to?

有没有办法更改日志文件的写入位置?

Thanks.

谢谢。

采纳答案by pepoluan

I don't know the answer to the first and second question, but for the third question:

我不知道第一和第二个问题的答案,但对于第三个问题:

set xfer:log-file "/path/to/your/file.log"

回答by lav

When multiple instances of lftp write to the same log file it can be mixed up (as current lftp 4.7.1 does not use file locking for the log file). At best the lines will be interleaved.

当 lftp 的多个实例写入同一个日志文件时,它可能会混淆(因为当前的 lftp 4.7.1 不为日志文件使用文件锁定)。最好的情况是这些行会交错。

The setting xfer:log-file appeared in lftp version 4.2.0.

设置 xfer:log-file 出现在 lftp 4.2.0 版中。