【问题标题】:writing sysdig output to a file将 sysdig 输出写入文件
【发布时间】:2018-07-02 13:13:14
【问题描述】:

我想在我的服务器上检查我的用户命令一段时间,所以我使用带有 nohup 的 sysdig 命令。我想将输出写入这样的文件:

# nohup sysdig -c spy_users 1>>/path/to/true 2>>/path/to/false &

但结果不会实时写入文件。有什么想法吗?

【问题讨论】:

  • 如果你杀死你的sysdig,它会刷新缓冲区,你会在文件中看到输出。

标签: bash stdout stderr nohup sysdig


【解决方案1】:

可能它正在被缓冲。尝试将缓冲设置为 line-buffer 或完全停用它:

nohup stdbuf -oL -eL sysdig -c spy_users 1>>/path/to/true 2>>/path/to/false &

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-18
    • 1970-01-01
    相关资源
    最近更新 更多