V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
rzdCG
V2EX  ›  Linux

想问一下在 Linux 下我该如何监听在接下来的一段时间内系统的文件写入情况

  •  
  •   rzdCG · 2023-05-19 15:22:29 +08:00 · 1122 次点击
    这是一个创建于 366 天前的主题,其中的信息可能已经有所发展或是发生改变。
    7 条回复    2023-05-20 17:07:14 +08:00
    tensorzhang
        1
    tensorzhang  
       2023-05-19 15:28:05 +08:00
    watchdog ?
    aloxaf
        2
    aloxaf  
       2023-05-19 15:32:17 +08:00
    fanotify ?
    garychenlin
        3
    garychenlin  
       2023-05-19 15:39:38 +08:00
    audit ?
    defunct9
        4
    defunct9  
       2023-05-19 15:42:30 +08:00
    go 写个 inotify
    barathrum
        5
    barathrum  
       2023-05-19 15:58:20 +08:00
    systemtap 或 eBPF 之类的应该能做吧
    LindsayZhou
        6
    LindsayZhou  
       2023-05-19 16:21:47 +08:00   ❤️ 1
    搜了一下,bcc 的示例里已经有相关的了: https://github.com/iovisor/bcc/blob/master/tools/filetop.py

    ebpf + kprobe ,要定制化自己简单改下就行了。
    julyclyde
        7
    julyclyde  
       2023-05-20 17:07:14 +08:00
    进程视角:strace
    文件被动视角:inotify
    开放视角:systemtap 、eBPF 之类的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5571 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 02:45 · PVG 10:45 · LAX 19:45 · JFK 22:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.