帮助:

JDU:/host-001e67a8d50b /log/today # inotifywait -h
inotifywait 3.14
Wait for a particular event on a file or set of files.
Usage: inotifywait [ options ] file1 [ file2 ] [ file3 ] [ ... ]
Options:
-h|--help Show this help text.
@<file> Exclude the specified file from being watched.
--exclude <pattern>
Exclude all events on files matching the
extended regular expression <pattern>.
--excludei <pattern>
Like --exclude but case insensitive.
-m|--monitor Keep listening for events forever. Without
this option, inotifywait will exit after one
event is received.
-d|--daemon Same as --monitor, except run in the background
logging events to a file specified by --outfile.
Implies --syslog.
-r|--recursive Watch directories recursively.
--fromfile <file>
Read files to watch from <file> or `-' for stdin.
-o|--outfile <file>
Print events to <file> rather than stdout.
-s|--syslog Send errors to syslog rather than stderr.
-q|--quiet Print less (only print events).
-qq Print nothing (not even events).
--format <fmt> Print using a specified printf-like format
string; read the man page for more details.
--timefmt <fmt> strftime-compatible format string for use with
%T in --format string.
-c|--csv Print events in CSV format.
-t|--timeout <seconds>
When listening for a single event, time out after
waiting for an event for <seconds> seconds.
If <seconds> is , inotifywait will never time out.
-e|--event <event1> [ -e|--event <event2> ... ]
Listen for specific event(s). If omitted, all events are
listened for.
Exit status:
- An event you asked to watch for was received.
- An event you did not ask to watch for was received
- The --timeout option was given and no events occurred
in the specified interval of time.
Events:
access file or directory contents were read
modify file or directory contents were written
attrib file or directory attributes changed
close_write file or directory closed, after being opened in writable mode
close_nowrite file or directory closed, after being opened in read-only mode
close file or directory closed, regardless of read/write mode
open file or directory opened
moved_to file or directory moved to watched directory
moved_from file or directory moved from watched directory
move file or directory moved to or from watched directory
create file or directory created within watched directory
delete file or directory deleted within watched directory
delete_self file or directory was deleted
unmount file system containing file or directory unmounted

示例:

JDU:aSV/host-001e67a8d50b /sf # inotifywait -rme access,modify,open,close /sf/data/vs_rep2/images/
Setting up watches. Beware: since -r was given, this may take a while!
Watches established.
/sf/data/vs_rep2/images/ OPEN,ISDIR
/sf/data/vs_rep2/images/ CLOSE_NOWRITE,CLOSE,ISDIR
/sf/data/vs_rep2/images/ OPEN,ISDIR cluster
/sf/data/vs_rep2/images/cluster/ OPEN,ISDIR
/sf/data/vs_rep2/images/ CLOSE_NOWRITE,CLOSE,ISDIR cluster
/sf/data/vs_rep2/images/cluster/ CLOSE_NOWRITE,CLOSE,ISDIR

linux inotifywait 下监控是否有IO的更多相关文章

  1. linux下监控jvm 使用的方法

    之前一直用jconsole监控jvm,图形界面简单易用,最近因为需要在纯linux下进行操作,所以总结了一下 linux下监控jvm的例子,这次主要用到了jstat工具, 各个参数意义: jstat ...

  2. Linux 环境下 网络IO模型

    本文讨论的背景是Linux环境下的network IO. IO发生时涉及的对象和步骤: 对于一个network IO (这里我们以read举例),它会涉及到两个系统对象,一个是调用这个IO的proce ...

  3. Linux 下监控用户最大进程数参数(nproc)是否到达上限

    Linux 下监控用户最大进程数参数(nproc)是否到达上限的步骤: 1.查看各系统用户的进程(LWP)数: 注意:默认情况下采用 ps 命令并不能显示出所有的进程.因为 Linux 环境下执行多线 ...

  4. Linux 下的五种 IO 模型

    概念说明 用户空间与内核空间 现在操作系统都是采用虚拟存储器,那么对32位操作系统而言,它的寻址空间(虚拟存储空间)为4G(2的32次方).操作系统的核心是内核,独立于普通的应用程序,可以访问受保护的 ...

  5. linux下监控进程需掌握的四个命令

    linux下监控进程需掌握的四个命令   在LInux系统下,最困难的工作之一就是跟踪正在系统中运行的程序,尤其是现在,图形桌面使用很多的程序,只是为了生成一个桌面环境,系统中运行了太多的进程,幸运的 ...

  6. 操作系统复习——如何查看一个进程的详细信息,如何追踪一个进程的执行过程 ,如何在 Linux 系统下查看 CPU、内存、磁盘、IO、网卡情况?epoll和select区别?

    1. 如何查看一个进程的详细信息,如何追踪一个进程的执行过程 通过pstree命令(根据pid)进行查询进程内部当前运行了多少线程:# pstree -p 19135(进程号) 使用top命令查看(可 ...

  7. Linux下监控网卡流量的软件Nload

    Linux下监控网卡流量的软件Nload 安装nload: # wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz # tar zxvf ...

  8. Linux环境下的network IO

    同步IO和异步IO,阻塞IO和非阻塞IO分别是什么,到底有什么区别?不同的人在不同的上下文下给出的答案是不同的.所以先限定一下本文的上下文. 本文讨论的背景是Linux环境下的network IO. ...

  9. Linux 下监控用户最大进程数参数(nproc)是否到达上限的步骤:

    https://www.cnblogs.com/autopenguin/p/6184886.html 1.查看各系统用户的进程(LWP)数: 注意:默认情况下采用 ps 命令并不能显示出所有的进程.因 ...

随机推荐

  1. (轉)CSS 单行溢出文本显示省略号...的方法(兼容IE FF)

    轉自:http://www.cnblogs.com/hlz789456123/archive/2009/02/18/1392972.html html代码:<div><p>&l ...

  2. ARPG游戏打击感相关的技术简单总结

    说好的技术总结,根据近期的工作总结一下体现游戏打击感相关的技术.一般arpg的游戏打击感除了场景的氛围的烘托,策划的数值:连击,奖励伤害数字的连贯积累反馈,硬直加物理击飞ragdoll,更不可忽视的也 ...

  3. Android-封装JSON数据(JSON对象/JSON数组)

    Android-封装JSON数据(JSON对象/JSON数组),一般情况下不会在Android端封装JSON的数据,因为封装JSON的数据是在服务器端进行封装了,Android更多的工作是解析(JSO ...

  4. Android-FileIOUtils工具类

    文件读写相关工具类 public final class FileIOUtils { private FileIOUtils() { throw new UnsupportedOperationExc ...

  5. task3:词频统计

    相关的类: java.util.regex.Pattern static Pattern compile(String regex) //编译模式 static Pattern compile(Str ...

  6. mysql server 自动断开的问题

    今天发现mysql的一个问题,当跑update语句的时候,mysql 服务会自动断掉,无论用 phpmyadmin, navicat , mysql workbench 甚至用 mysql命令行效果一 ...

  7. ubuntu16.04 安装jdk 错误解决

    错误 $ apt-get install openjdk-9-jdk Errors were encountered while processing: /var/cache/apt/archives ...

  8. asp.net——Base64加密解密

    /// <summary> /// 实现Base64加密解密 /// </summary> public sealed class Base64 { /// <summa ...

  9. Jquery 记一次使用fullcalendar的使用记录

    最近接了一个需求,把excel做的表格开发到系统里,本来想直接做成表格的形式,后来考虑到数据库中的表结构不好设计,最后决定做成日历的形式: 先上成品图 需要引用的js,fullcalendar官网可以 ...

  10. c++define的用法

    c++define的用法   在写程序时经常会碰到这样一个问题,我们需要重复写很多相同的代码,并且这些代码结构相同.总是想自己把这段代码封装一下然后直接进行调用,但是如果这段代码逻辑并不复杂,并且代码 ...