首页 > 解决方案 > "tail -F" equivalent in lftp

问题描述

I'm currently looking for tips to simulate a tail -F in lftp. The goal is to monitor a log file the same way I could do with a proper ssh connection.

The closest command I found for now is repeat cat logfile. It works but that not the best when my file is too big cause it displays each time all the file.

标签: lftp

解决方案


lftp程序特别不支持这一点,但如果服务器支持扩展,则可以仅从文件中提取最后一个 $x 字节,例如curl --range(参见这个 serverfault answer)。这与一些逻辑相结合,只抓取自上次轮询以来添加的字节数,可以让您相对有效地执行此操作。我怀疑是否有任何现成的具有此功能的 FTP 客户端,但其他人可能更了解。


推荐阅读