{"id":6620,"date":"2020-02-14T14:23:57","date_gmt":"2020-02-14T06:23:57","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6620"},"modified":"2020-05-23T21:26:08","modified_gmt":"2020-05-23T13:26:08","slug":"inotifywatch","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/inotifywatch","title":{"rendered":"inotifywatch\u547d\u4ee4 – \u6536\u96c6\u5173\u4e8e\u88ab\u76d1\u89c6\u7684\u6587\u4ef6\u7cfb\u7edf\u7684\u7edf\u8ba1\u6570\u636e"},"content":{"rendered":"\n

inotifywatch\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u6536\u96c6\u88ab\u76d1\u89c6\u7684\u6587\u4ef6\u7cfb\u7edf\u7684\u7edf\u8ba1\u6570\u636e\uff0c\u7edf\u8ba1\u6587\u4ef6\u7cfb\u7edf\u8bbf\u95ee\u7684\u6b21\u6570\uff0c \u5305\u62ec\u6bcf\u4e2ainotify\u4e8b\u4ef6\u53d1\u751f\u591a\u5c11\u6b21\u3002 <\/p>\n\n\n\n

inotifywatch\u4ee5\u6807\u51c6\u8f93\u51fa\u65b9\u5f0f\u8f93\u51fa\u4e00\u4e2a\u8868\uff0c\u6bcf\u79cd\u7c7b\u578b\u7684\u4e8b\u4ef6\u4e3a\u4e00\u5217\uff0c\u6bcf\u4e2a\u76d1\u89c6\u7684\u6587\u4ef6\u6216\u76ee\u5f55\u4e3a\u4e00\u884c\u3002 \u8be5\u8868\u663e\u793a\u7684\u662f\u6bcf\u4e2a\u88ab\u76d1\u89c6\u7684\u6587\u4ef6\u6216\u76ee\u5f55\u4e2d\u4e8b\u4ef6\u53d1\u751f\u7684\u6b21\u6570\u3002 \u53ef\u4ee5\u4f7f\u7528-a\u6216-d\u53c2\u6570\u5bf9\u7279\u5b9a\u4e8b\u4ef6\u5bf9\u8f93\u51fa\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n\n\n\n

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

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

-a<event><\/td>\u6309\u6307\u5b9a\u4e8b\u4ef6\u8ba1\u6570\u7684\u5347\u5e8f\u6392\u5e8f\u8f93\u51fa<\/td><\/tr>
--<\/strong>d<event><\/td>\u6309\u6307\u5b9a\u4e8b\u4ef6\u8ba1\u6570\u7684\u964d\u5e8f\u6392\u5e8f\u8f93\u51fa<\/td><\/tr>
-fromfile<file><\/td>\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u9700\u8981\u76d1\u63a7\u7684\u6587\u4ef6\u6216\u6392\u9664\u7684\u6587\u4ef6<\/td><\/tr>
-z<\/td>\u8f93\u51fa\u8868\u683c\u7684\u884c\u548c\u5217\uff0c\u5373\u4f7f\u5143\u7d20\u4e3a\u7a7a<\/td><\/tr>
-r<\/td>\u76d1\u89c6\u4e00\u4e2a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u5b50\u76ee\u5f55<\/td><\/tr>
-t<\/td>\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4<\/td><\/tr>
-e<event><\/td>\u53ea\u76d1\u542c\u6307\u5b9a\u7684\u4e8b\u4ef6<\/td><\/tr>
-- -exclude <pattern><\/td>\u4e0d\u5904\u7406\u6587\u4ef6\u540d\u4e0e\u6307\u5b9a\u7684POSIX\u6269\u5c55\uff0c\u533a\u5206\u5927\u5c0f\u5199<\/td><\/tr>
-- -excludei <pattern><\/td>\u4e0d\u5904\u7406\u6587\u4ef6\u540d\u4e0e\u6307\u5b9a\u7684POSIX\u6269\u5c55\uff0c\u4e0d\u533a\u5206\u5927\u5c0f\u5199<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u7edf\u8ba1\/linuxcool\u76ee\u5f5560\u79d2\u5185\u7684\u76f8\u5173\u6570\u636e\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# inotifywatch -v -e access -e modify -t 60 -r \/linuxcool      <\/pre>\n\n\n\n

\u7edf\u8ba1\/linuxcool\u76ee\u5f55\u4fe1\u606f\u4ee5\u8868\u683c\u5f62\u5f0f\u8f93\u51fa\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# inotifywatch -z \/linuxcool<\/pre>\n\n\n\n

\u7edf\u8ba1\u76ee\u5f55\u4ea7\u751f\u7684\u6307\u5b9a\u4e8b\u4ef6\uff1a<\/p>\n\n\n\n

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

inotifywatch\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u6536\u96c6\u88ab\u76d1\u89c6\u7684\u6587\u4ef6\u7cfb\u7edf\u7684\u7edf\u8ba1\u6570\u636e\uff0c\u7edf\u8ba1\u6587\u4ef6\u7cfb\u7edf\u8bbf\u95ee\u7684\u6b21\u6570\uff0c \u5305\u62ec\u6bcf\u4e2ainot […]<\/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\/6620"}],"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=6620"}],"version-history":[{"count":9,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6620\/revisions"}],"predecessor-version":[{"id":7767,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6620\/revisions\/7767"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}