inotify
Inotify可用于检测单个文件,也可以检测整个目录。当检测的对象是一个目录的时候,目录本身和目录里的内容都会成为检测的对象。

rpm -qa inotify-tools #如果没安装

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum install inotify-tools -y
参数详解

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  写入之后关闭

                        writeable 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卸载

 

posted on 2024-11-20 19:57  属于我的梦,明明还在  阅读(38)  评论(0编辑  收藏  举报