Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 396 Bytes

案例3.md

File metadata and controls

24 lines (18 loc) · 396 Bytes

监控文件是否改动

监控主要文件是否改动

  local ud = vela.fsnotify{
    name = "ff",
    path = "/etc/",
  }

  ud.filter("op eq WRITE" , "name = /etc/passwd") --cond 过滤

  ud.pipe(function(ev)
      print(ev.op)
      print(ev.name) -- filename
      print(ev.write) -- true
      print(ev.time) -- true
  end)

  ud.on_err(function(err)
  end)

  ud.start()