{"id":6586,"date":"2020-02-14T12:56:46","date_gmt":"2020-02-14T04:56:46","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6586"},"modified":"2020-05-23T21:26:04","modified_gmt":"2020-05-23T13:26:04","slug":"inotifywait","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/inotifywait","title":{"rendered":"inotifywait\u547d\u4ee4 – \u5f02\u6b65\u6587\u4ef6\u7cfb\u7edf\u76d1\u63a7"},"content":{"rendered":"\n

inotifywait\u547d\u4ee4\u4f5c\u7528\u662f\u7528\u6765\u6536\u96c6\u6709\u5173\u6587\u4ef6\u8bbf\u95ee\u4fe1\u606f\u3002<\/p>\n\n\n\n

linux\u53d1\u884c\u7248\u4e00\u822c\u6ca1\u6709\u5305\u62ec\u8fd9\u4e2a\u547d\u4ee4\uff0c\u9700\u8981\u5b89\u88c5inotify-tools\uff0c\u8fd9\u4e2a\u547d\u4ee4\u8fd8\u9700\u8981\u5c06inotify\u652f\u6301\u7f16\u8bd1\u5165linux\u5185\u6838\uff0c\u76ee\u524d\u5927\u591a\u6570linux\u53d1\u884c\u7248\u90fd\u5728\u5185\u6838\u4e2d\u542f\u7528\u4e86inotify\u3002 <\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>inotifywait [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-m<\/td>\u6301\u7eed\u76d1\u89c6\u53d8\u5316<\/td><\/tr>
-r<\/td>\u4f7f\u7528\u9012\u5f52\u5f62\u5f0f\u76d1\u89c6\u76ee\u5f55<\/td><\/tr>
-q<\/td>\u51cf\u5c11\u5197\u4f59\u4fe1\u606f\uff0c\u53ea\u6253\u5370\u51fa\u9700\u8981\u7684\u4fe1\u606f<\/td><\/tr>
-e<\u4e8b\u4ef6><\/td>\u6307\u5b9a\u8981\u76d1\u89c6\u7684\u4e8b\u4ef6\u5217\u8868<\/td><\/tr>
-- -timefmt<\/td>\u6307\u5b9a\u65f6\u95f4\u7684\u8f93\u51fa\u683c\u5f0f<\/td><\/tr>
-- -format<\/td>\u6307\u5b9a\u6587\u4ef6\u53d8\u5316\u7684\u8be6\u7ec6\u4fe1\u606f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u6301\u7eed\u76d1\u542c\/linuxcool\u76ee\u5f55\u7684\u53d8\u5316\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# inotifywait -m \/linuxcool<\/pre>\n\n\n\n

\u76d1\u542c\/linuxcool\u76ee\u5f55\u4e0b\u5de6\u53f3\u5b50\u76ee\u5f55\u7684\u53d8\u5316\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# inotifywait -mr \/linuxcool<\/pre>\n\n\n\n

\u76d1\u542c\/linuxcool\u76ee\u5f55\u53d1\u751f\u7684\u6307\u5b9a\u4e8b\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# inotifywait -e move \/linuxcool<\/pre>\n","protected":false},"excerpt":{"rendered":"

inotifywait\u547d\u4ee4\u4f5c\u7528\u662f\u7528\u6765\u6536\u96c6\u6709\u5173\u6587\u4ef6\u8bbf\u95ee\u4fe1\u606f\u3002 linux\u53d1\u884c\u7248\u4e00\u822c\u6ca1\u6709\u5305\u62ec\u8fd9\u4e2a\u547d\u4ee4\uff0c\u9700\u8981\u5b89\u88c5in […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6586"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=6586"}],"version-history":[{"count":8,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6586\/revisions"}],"predecessor-version":[{"id":7766,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6586\/revisions\/7766"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}