lftp - "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
程序特别不支持这一点,但如果服务器支持扩展,则可以仅从文件中提取最后一个 $x 字节,例如curl --range
(参见这个 serverfault answer)。这与一些逻辑相结合,只抓取自上次轮询以来添加的字节数,可以让您相对有效地执行此操作。我怀疑是否有任何现成的具有此功能的 FTP 客户端,但其他人可能更了解。
推荐阅读
- python - 如何在 sympy 中简化为求和符号?
- sql - 为 BCP 创建 SQL 查询的字符串格式问题
- linux - 从 crontab 运行时预期脚本失败,但在手动运行时有效
- javascript - 使用适用于 JavaScript 的 AWS 开发工具包在 DynamoDB 中加载示例数据
- r - Shiny 不会将下载的文件保存在使用 output_dir 设置的文件夹中
- http - 使用 Groovy 重写 curl http 请求
- csv - 带有 csv 数据的 Higcharts 人口金字塔
- sql - 使用 BigQuery Firebase 数据在用户执行 event_name = 'app_remove' 之前查询事件
- python - flask-migrate 卡在包含枚举字段的表的降级上
- python - 使用从一个类到另一个 tkinter 的变量