{"id":2732,"date":"2016-06-07T16:00:07","date_gmt":"2016-06-07T08:00:07","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=2732"},"modified":"2016-06-07T16:00:07","modified_gmt":"2016-06-07T08:00:07","slug":"linux%e4%b8%8binotify%e7%9a%84%e5%ad%a6%e4%b9%a0%e5%92%8c%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/2732.html","title":{"rendered":"Linux\u4e0bInotify\u7684\u5b66\u4e60\u548c\u4f7f\u7528"},"content":{"rendered":"<p>=Start=<\/p>\n<h5>\u7f18\u7531\uff1a<\/h5>\n<p>\u5728Linux\u4e0b\u9700\u8981\u76d1\u63a7\u67d0\u4e2a\u6587\u4ef6\/\u76ee\u5f55\u7684\u53d8\u5316\u5e76\u8fdb\u884c\u901a\u77e5\uff0c\u5e38\u7528\u7684\u300ctail -f\u300d\u53ef\u4ee5\u5bf9\u6587\u4ef6\u5185\u5bb9\u8fdb\u884c\u76d1\u63a7\uff0c\u4f46\u662f\u5bf9\u4e8e\u76ee\u5f55\u4e00\u7ea7\u7684\u76d1\u63a7\u5b83\u5c31\u6ca1\u4ec0\u4e48\u529e\u6cd5\u4e86\u3002\u4e4b\u524d\u6709\u4e86\u89e3\u8fc7Linux\u7684Inotify\u673a\u5236\uff0c\u8fd9\u6b21\u8d81\u7740\u673a\u4f1a\u91cd\u65b0\u5b66\u4e60\u4e00\u4e0b\uff0c\u5e76\u6574\u7406\u4e00\u4e9b\u5e38\u89c1\u811a\u672c\u65b9\u4fbf\u65e5\u5e38\u4f7f\u7528\u3001\u53c2\u8003\u3002<\/p>\n<h5>\u6b63\u6587\uff1a<\/h5>\n<h6>0x01.Inotify\u662f\u4ec0\u4e48\uff1f<\/h6>\n<p>Inotify\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u3001\u7ec6\u7c92\u5ea6\u7684\u3001<span style=\"color: #0000ff;\"><strong>\u5f02\u6b65\u7684\u6587\u4ef6\u7cfb\u7edf\u4e8b\u4ef6\u76d1\u63a7\u673a\u5236<\/strong><\/span>\uff0c<span style=\"color: #0000ff;\">Linux\u5185\u6838\u4ece2.6.13\u5f00\u59cb\u5f15\u5165<\/span>\uff0c\u5141\u8bb8\u76d1\u63a7\u7a0b\u5e8f\u6253\u5f00\u4e00\u4e2a\u72ec\u7acb\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u5e76\u9488\u5bf9\u4e8b\u4ef6\u96c6\u76d1\u63a7\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u6587\u4ef6\uff0c\u4f8b\u5982\u6253\u5f00\u3001\u5173\u95ed\u3001\u79fb\u52a8\/\u91cd\u547d\u540d\u3001\u5220\u9664\u3001\u521b\u5efa\u6216\u8005\u6539\u53d8\u5c5e\u6027\u3002<\/p>\n<h6>0x02.\u6211\u7684\u7cfb\u7edf\u662f\u5426\u652f\u6301Inotify\u673a\u5236\uff1f<\/h6>\n<p>\u65b9\u6cd5\u4e00\uff1a\u5224\u65ad\u4f60\u7684Linux\u5185\u6838\u662f\u5426\u652f\u6301Inotify\u673a\u5236\u53ef\u4ee5\u901a\u8fc7\u6267\u884c\u4e0b\u9762\u8fd9\u6761\u547d\u4ee4\uff1a<\/p>\n<pre class=\"lang:default decode:true\">$ grep INOTIFY_USER \/boot\/config-$(uname -r)<\/pre>\n<p>\u5982\u679c\u8f93\u51fa\u300cCONFIG_INOTIFY_USER=y\u300d\uff0c\u5c31\u8868\u793a\u4f60\u7684\u5185\u6838\u652f\u6301Inotify\u673a\u5236\u3002<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a\u8fd8\u53ef\u4ee5\u4f7f\u7528\u300cll \/proc\/sys\/fs\/inotify\u300d\u547d\u4ee4\uff0c\u662f\u5426\u6709\u4ee5\u4e0b\u4e09\u6761\u4fe1\u606f\u8f93\u51fa\uff0c\u5982\u679c\u6ca1\u6709\u8868\u793a\u4e0d\u652f\u6301\u3002<\/p>\n<pre class=\"lang:default decode:true \">-rw-r--r-- 1 root root 0 5\u6708 31 11:23 max_queued_events\n-rw-r--r-- 1 root root 0 5\u6708 31 11:23 max_user_instances\n-rw-r--r-- 1 root root 0 5\u6708 31 11:23 max_user_watches<\/pre>\n<ul>\n<li>\/proc\/sys\/fs\/inotify\/max_queued_evnets \u8868\u793a\u8c03\u7528inotify_init\u65f6\u5206\u914d\u7ed9inotify instance\u4e2d\u53ef\u6392\u961f\u7684event\u7684\u6570\u76ee\u7684\u6700\u5927\u503c\uff0c\u8d85\u51fa\u8fd9\u4e2a\u503c\u7684\u4e8b\u4ef6\u88ab\u4e22\u5f03\uff0c\u4f46\u4f1a\u89e6\u53d1IN_Q_OVERFLOW\u4e8b\u4ef6\u3002<\/li>\n<li>\/proc\/sys\/fs\/inotify\/max_user_instances \u8868\u793a\u6bcf\u4e00\u4e2areal user ID\u53ef\u521b\u5efa\u7684inotify instatnces\u7684\u6570\u91cf\u4e0a\u9650\u3002<\/li>\n<li>\/proc\/sys\/fs\/inotify\/max_user_watches \u8868\u793a\u6bcf\u4e2ainotify instatnces\u53ef\u76d1\u63a7\u7684\u6700\u5927\u76ee\u5f55\u6570\u91cf\u3002\u5982\u679c\u76d1\u63a7\u7684\u6587\u4ef6\u6570\u76ee\u5de8\u5927\uff0c\u9700\u8981\u6839\u636e\u60c5\u51b5\uff0c\u9002\u5f53\u589e\u52a0\u6b64\u503c\u7684\u5927\u5c0f\u3002<\/li>\n<\/ul>\n<p>\u53e6\uff1aGNU\u7684coreutils\u4ece7.5\u7248\u672c\u5f00\u59cb\u4e5f\u652f\u6301Inotify\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u786e\u8ba4\uff1a<\/p>\n<pre class=\"lang:default decode:true \">#\u67e5\u770b\u7cfb\u7edf\u4e0acoreutils\u7684\u7248\u672c\u4fe1\u606f\uff1a\n# yum info coreutils\n\n#\u9a8c\u8bc1coreutils\u662f\u5426\u4f7f\u7528\u4e86Inotify\u673a\u5236\n# strace -e inotify_init,inotify_add_watch tail -f \/var\/log\/dmesg\n...\ninotify_init() = 4\ninotify_add_watch(4, \"\/var\/log\/dmesg\", IN_MODIFY|IN_ATTRIB|IN_DELETE_SELF|IN_MOVE_SELF) = 1\n...<\/pre>\n<p>\u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u901a\u8fc7\u8f6e\u8be2\u6765\u786e\u8ba4\u6587\u4ef6\u662f\u5426\u9700\u8981\u91cd\u65b0\u8bfb\u53d6\u7684\u65b9\u6cd5\u5e94\u8be5\u4f5c\u4e3a\u53e4\u8463\u4e86\u3002<\/p>\n<h6>0x03.\u5982\u4f55\u5b89\u88c5inotify-tools\uff1f<\/h6>\n<p>\u9700\u8981\u8bf4\u660e\u7684\u662f\uff1aInotify\u662f\u4e00\u79cd\u5f02\u6b65\u7684\u6587\u4ef6\u7cfb\u7edf\u4e8b\u4ef6\u76d1\u63a7\u673a\u5236\uff0c\u800c\u975e\u5177\u4f53\u7684\u5de5\u5177\u3002\u5982\u679c\u5e0c\u671b\u5728Linux\u7cfb\u7edf\u4e0a\u5229\u7528\u8be5\u673a\u5236\u8fdb\u884c\u6587\u4ef6\/\u76ee\u5f55\u7684\u76d1\u63a7\u7684\u8bdd\uff0c\u53ef\u4ee5\u4f7f\u7528inotify-tools\u3002<a href=\"https:\/\/github.com\/rvoicilas\/inotify-tools\">inotify-tools<\/a>\u662f\u7528 C\u8bed\u8a00 \u5b9e\u73b0\u7684\u548cInotify\u63a5\u53e3\u8fdb\u884c\u4ea4\u4e92\u7684 \u5e93\u548c\u5de5\u5177\u96c6\uff0c\u73b0\u5728\u6700\u65b0\u7248\u7684inotify-tools\u662f2010.3.7\u65e5\u53d1\u5e03\u7684<a href=\"http:\/\/github.com\/downloads\/rvoicilas\/inotify-tools\/inotify-tools-3.14.tar.gz\">3.14\u7248<\/a>\u3002\u4f60\u53ef\u4ee5\u624b\u52a8\u4ece\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528Linux\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5de5\u5177\u8fdb\u884c\u5b89\u88c5\u3002\u4e0b\u9762\u4ee5CentOS 6.5\u4e3a\u4f8b\u8bf4\u660eInotify\u7684\u5b89\u88c5\u8fc7\u7a0b\uff08\u63a8\u8350\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\uff09\uff1a<\/p>\n<pre class=\"lang:default decode:true \">$ yum search inotify-tools\n$ yum info inotify-tools\n$ sudo yum install inotify-tools\n\n#\u6216\n\n$ wget http:\/\/github.com\/downloads\/rvoicilas\/inotify-tools\/inotify-tools-3.14.tar.gz\n$ tar zxf inotify-tools-3.14.tar.gz\n$ cd inotify-tools-3.14\/\n$ .\/configure --prefix=\/usr &amp;&amp; make &amp;&amp; su -c 'make install'<\/pre>\n<h6>0x04.\u4f7f\u7528Inotify\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\uff1f<\/h6>\n<p>\u4f7f\u7528Inotify\u65f6\uff0c\u8981\u7279\u522b\u6ce8\u610f\u5185\u6838\u4e2d\u5173\u4e8e\u5b83\u7684\u4e24\u4e2a\u914d\u7f6e\u3002\u9996\u5148\u300c\/proc\/sys\/fs\/inotify\/max_user_instances\u300d\u89c4\u5b9a\u4e86\u6bcf\u4e2a\u7528\u6237\u6240\u80fd\u521b\u5efa\u7684Inotify\u5b9e\u4f8b\u7684\u4e0a\u9650\uff1b\u5176\u6b21\u300c\/proc\/sys\/fs\/inotify\/max_user_watches\u300d\u89c4\u5b9a\u4e86\u6bcf\u4e2aInotify\u5b9e\u4f8b\u6700\u591a\u80fd\u5173\u8054\u51e0\u4e2a\u76d1\u63a7(watch)\u3002\u4f60\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u8bd5\u9a8c\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u8fbe\u5230\u4e0a\u9650\uff0c\u5982\uff1a<\/p>\n<pre class=\"lang:default decode:true \"># inotifywait -r \/\nSetting up watches. Beware: since -r was given, this may take a while!\nFailed to watch \/; upper limit on inotify watches reached!\nPlease increase the amount of inotify watches allowed per user via `\/proc\/sys\/fs\/inotify\/max_user_watches'.<\/pre>\n<p>\u5982\u679c\u8981\u6539\u53d8\u8fd9\u4e9b\u914d\u7f6e\uff0c\u53ea\u8981\u5411\u76f8\u5e94\u7684\u6587\u4ef6\u5199\u5165\u65b0\u503c\u5373\u53ef\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre class=\"lang:default decode:true \"># cat \/proc\/sys\/fs\/inotify\/max_user_watches\n8192\n# echo 16000 &gt; \/proc\/sys\/fs\/inotify\/max_user_watches\n# cat \/proc\/sys\/fs\/inotify\/max_user_watches\n16000<\/pre>\n<h6>0x05.Inotify\u4f7f\u7528\u793a\u4f8b<\/h6>\n<pre class=\"lang:default decode:true \" title=\"inotifywait\u5e38\u7528\u53c2\u6570\">inotifywait\u7684\u5e38\u7528\u53c2\u6570\uff1a\n\n--timefmt \u65f6\u95f4\u683c\u5f0f\n    %y\u5e74 %m\u6708 %d\u65e5 %H\u5c0f\u65f6 %M\u5206\u949f\n--format \u8f93\u51fa\u683c\u5f0f\n    %T\u65f6\u95f4 %w\u8def\u5f84 %f\u6587\u4ef6\u540d %e\u72b6\u6001\n\n-m \u59cb\u7ec8\u4fdd\u6301\u76d1\u542c\u72b6\u6001\uff0c\u9ed8\u8ba4\u89e6\u53d1\u4e8b\u4ef6\u5373\u9000\u51fa\n-r \u9012\u5f52\u67e5\u8be2\u76ee\u5f55\n-q \u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u8f93\u51fa(\u53ea\u6253\u5370\u4e8b\u4ef6\u4fe1\u606f)\n\n-e \u5b9a\u4e49\u76d1\u63a7\u7684\u4e8b\u4ef6\uff0c\u53ef\u7528\u53c2\u6570\uff1a\n    open   \u6253\u5f00\u6587\u4ef6\n    access \u8bbf\u95ee\u6587\u4ef6\n    modify \u4fee\u6539\u6587\u4ef6\n    delete \u5220\u9664\u6587\u4ef6\n    create \u65b0\u5efa\u6587\u4ef6\n    attrib \u5c5e\u6027\u53d8\u66f4\n\n--exclude &lt;pattern&gt; \u6307\u5b9a\u8981\u6392\u9664\u76d1\u63a7\u7684\u6587\u4ef6\/\u76ee\u5f55<\/pre>\n<pre class=\"lang:default decode:true\" title=\"inotifywait\u4f7f\u7528\u793a\u4f8b\">#!\/bin\/bash\n\nMONITOR_DIR=\"\/tmp\/src\"\n\n# inotifywait -mr --timefmt '%d\/%m\/%y %H:%M' --format '%T %w %f' -e close_write,modify,delete,create,attrib $MONITOR_DIR | while read DATE TIME DIR FILE; do\n\n# inotifywait -mr -e close_write,modify,delete,create,attrib $MONITOR_DIR | while read path action file; do\n# inotifywait -mr --format '%w %e %f' -e close_write,modify,delete,create,attrib $MONITOR_DIR | while read path action file; do\n\n# inotifywait -mr --timefmt '%F_%T' --format '%w %e %f %T' -e close_write,modify,delete,create,attrib $MONITOR_DIR | while read path action file datetime; do\n# inotifywait --exclude '^\/tmp\/src\/mail\/(large|ignore)\/' -mr --timefmt '%F_%T' --format '%w %e %f %T' -e close_write,modify,delete,create,attrib $MONITOR_DIR | while read path action file datetime; do\n# inotifywait --exclude '(.*\/*\\.log|.*\/*\\.swp)$|^\/tmp\/src\/mail\/(2014|201.*\/cache.*)' -mr --timefmt '%F_%T' --format '%w %e %f %T' -e close_write,modify,delete,create,attrib $MONITOR_DIR | while read path action file datetime; do\n# inotifywait --exclude '(.*\/*\\.log|.*\/*\\.swp)$' --fromfile rule.list -mr --timefmt '%F_%T' --format '%w %e %f %T' -e close_write,modify,delete,create,attrib $MONITOR_DIR | while read path action file datetime; do\nwhile read path action file datetime; do\n\n    echo \"The file '$file' appeared in directory '$path' via '$action' @ '$datetime'\"\n    # FILECHANGE=${DIR}${FILE}\n    # echo \"At ${TIME} on ${DATE}, file $FILECHANGE was backed up via rsync\"\n\ndone &lt; &lt;(inotifywait --exclude '(.*\/*\\.log|.*\/*\\.swp)$' --fromfile rule.list -mr --timefmt '%F_%T' --format '%w %e %f %T' -e close_write,modify,delete,create,attrib $MONITOR_DIR)<\/pre>\n<pre class=\"lang:default decode:true\" title=\"inotifywait\u4f7f\u7528\u7684\u76f8\u5173\u8bf4\u660e\">\u6ce8\u610f\uff0c\u4e0a\u9762\u7684while\u5faa\u73af\uff0c\u4e0d\u8981\u4f7f\u7528 $() \u6765\u5305\u88f9 inotifywait \u547d\u4ee4\uff0c\u800c\u8981\u4f7f\u7528 &lt;() \uff0c\u5177\u4f53\u539f\u56e0\u53c2\u8003\uff1ahttp:\/\/unix.stackexchange.com\/questions\/140679\/using-inotify-to-monitor-a-directory-but-not-working-100 \u3002\n\ninotifywait\u6392\u9664\u76d1\u63a7\u76ee\u5f55\u6709 `--exclude &lt;pattern&gt;` \u548c `--fromfile &lt;file&gt;` \u4e24\u79cd\u683c\u5f0f\uff0c\u5e76\u4e14\u53ef\u4ee5\u540c\u65f6\u4f7f\u7528\uff0c\u4f46\u524d\u8005\u53ef\u4ee5\u7528\u6b63\u5219\uff0c\u800c\u540e\u8005\u53ea\u80fd\u662f\u5177\u4f53\u7684\u76ee\u5f55\u6216\u6587\u4ef6\u3002\n\n$ vi .\/rule.list\n\/tmp\/src\/pdf\n@\/tmp\/src\/2014\n\n\u4f7f\u7528fromfile\u683c\u5f0f\u53ea\u80fd\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u4e0d\u80fd\u4f7f\u7528\u8bf8\u5982*\u6b63\u5219\u8868\u8fbe\u5f0f\u53bb\u5339\u914d\uff0c@\u8868\u793a\u6392\u9664\u3002\n\n\u5982\u679c\u8981\u6392\u9664\u7684\u683c\u5f0f\u6bd4\u8f83\u590d\u6742\uff0c\u5fc5\u987b\u4f7f\u7528\u6b63\u5219\uff0c\u90a3\u53ea\u80fd\u5728inotifywait\u4e2d\u52a0\u5165\u9009\u9879\uff0c\u5982 `--exclude '(.*\/*\\.log|.*\/*\\.swp)$|^\/tmp\/src\/mail\/(2014|201.*\/cache.*)'` \uff0c\u8868\u793a\u6392\u9664\/tmp\/src\/mail\/\u4e0b\u76842014\u76ee\u5f55\uff0c\u548c\u6240\u6709201*\u76ee\u5f55\u4e0b\u7684\u5e26cache\u7684\u6587\u4ef6\u6216\u76ee\u5f55\uff0c\u4ee5\u53ca\/tmp\/src\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u4ee5.log\u6216.swp\u7ed3\u5c3e\u7684\u6587\u4ef6\u3002<\/pre>\n<h6>\u53c2\u8003\u94fe\u63a5\uff1a<\/h6>\n<div>=\u5b98\u65b9Wiki=<\/div>\n<div>\n<ul>\n<li><a href=\"https:\/\/github.com\/rvoicilas\/inotify-tools\/wiki\" target=\"_blank\">https:\/\/gith<wbr \/>ub.com\/rvoic<wbr \/>ilas\/inotify<wbr \/>-tools\/wiki<\/a><\/li>\n<\/ul>\n<\/div>\n<div>=\u4f7f\u7528\u8bf4\u660e\/\u793a\u4f8b=<\/div>\n<div>\n<ul>\n<li><a href=\"http:\/\/unix.stackexchange.com\/questions\/24952\/script-to-monitor-folder-for-new-files\" target=\"_blank\">http:\/\/unix.<wbr \/>stackexchang<wbr \/>e.com\/questi<wbr \/>ons\/24952\/sc<wbr \/>ript-to-moni<wbr \/>tor-folder-f<wbr \/>or-new-files<\/a><\/li>\n<li><a href=\"http:\/\/www.cyberciti.biz\/faq\/linux-inotify-examples-to-replicate-directories\/\" target=\"_blank\">http:\/\/www.c<wbr \/>yberciti.biz<wbr \/>\/faq\/linux-i<wbr \/>notify-examp<wbr \/>les-to-repli<wbr \/>cate-directo<wbr \/>ries\/<\/a>\u00a0 #incron\u7684\u4f7f\u7528<\/li>\n<li><a href=\"http:\/\/unix.stackexchange.com\/questions\/140679\/using-inotify-to-monitor-a-directory-but-not-working-100\" target=\"_blank\">http:\/\/unix.<wbr \/>stackexchang<wbr \/>e.com\/questi<wbr \/>ons\/140679\/u<wbr \/>sing-inotify<wbr \/>-to-monitor-<wbr \/>a-directory-<wbr \/>but-not-work<wbr \/>ing-100<\/a><\/li>\n<li><a href=\"http:\/\/techarena51.com\/index.php\/inotify-tools-example\/\" target=\"_blank\">http:\/\/techa<wbr \/>rena51.com\/i<wbr \/>ndex.php\/ino<wbr \/>tify-tools-e<wbr \/>xample\/<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Leo-G\/backup-bash\" target=\"_blank\">https:\/\/gith<wbr \/>ub.com\/Leo-G<wbr \/>\/backup-bash<\/a><\/li>\n<li><a href=\"https:\/\/linux.cn\/thread-13095-1-1.html\" target=\"_blank\">https:\/\/linu<wbr \/>x.cn\/thread-<wbr \/>13095-1-1.ht<wbr \/>ml<\/a><\/li>\n<li><a href=\"http:\/\/www.infoq.com\/cn\/articles\/inotify-linux-file-system-event-monitoring\" target=\"_blank\">http:\/\/www.i<wbr \/>nfoq.com\/cn\/<wbr \/>articles\/ino<wbr \/>tify-linux-f<wbr \/>ile-system-e<wbr \/>vent-monitor<wbr \/>ing<\/a><\/li>\n<li><a href=\"http:\/\/linux.die.net\/man\/1\/inotifywait\" target=\"_blank\">http:\/\/linux<wbr \/>.die.net\/man<wbr \/>\/1\/inotifywa<wbr \/>it<\/a><\/li>\n<li><a href=\"http:\/\/linux.die.net\/man\/1\/inotifywatch\" target=\"_blank\">http:\/\/linux<wbr \/>.die.net\/man<wbr \/>\/1\/inotifywa<wbr \/>tch<\/a><\/li>\n<li><a href=\"http:\/\/linuxaria.com\/article\/introduction-inotify\" target=\"_blank\">http:\/\/linux<wbr \/>aria.com\/art<wbr \/>icle\/introdu<wbr \/>ction-inotif<wbr \/>y<\/a><\/li>\n<li><a href=\"http:\/\/mageedu.blog.51cto.com\/4265610\/1549216\" target=\"_blank\">http:\/\/magee<wbr \/>du.blog.51ct<wbr \/>o.com\/426561<wbr \/>0\/1549216<\/a><\/li>\n<li><a href=\"https:\/\/baoz.net\/monitor-file-change-in-linux-via-inotify\/\" target=\"_blank\">https:\/\/baoz<wbr \/>.net\/monitor<wbr \/>-file-change<wbr \/>-in-linux-vi<wbr \/>a-inotify\/<\/a><\/li>\n<li><a href=\"http:\/\/www.haiyun.me\/archives\/inotify-tool-file.html\" target=\"_blank\">http:\/\/www.h<wbr \/>aiyun.me\/arc<wbr \/>hives\/inotif<wbr \/>y-tool-file.<wbr \/>html<\/a><\/li>\n<li><a href=\"http:\/\/segmentfault.com\/a\/1190000002427568\" target=\"_blank\">http:\/\/segme<wbr \/>ntfault.com\/<wbr \/>a\/1190000002<wbr \/>427568<\/a><\/li>\n<li><a href=\"http:\/\/seanlook.com\/2014\/12\/12\/rsync_inotify_setup\/\" target=\"_blank\">http:\/\/seanl<wbr \/>ook.com\/2014<wbr \/>\/12\/12\/rsync<wbr \/>_inotify_set<wbr \/>up\/<\/a><\/li>\n<li><a href=\"http:\/\/www.3mu.me\/inotify-tools%E7%9A%84inotifywait%E5%B7%A5%E5%85%B7%E7%94%A8exclude-%E5%92%8C-fromfile-%E6%8E%92%E9%99%A4%E6%8C%87%E5%AE%9A%E5%90%8E%E7%BC%80%E6%96%87%E4%BB%B6\/\" target=\"_blank\">http:\/\/www.3<wbr \/>mu.me\/inotif<wbr \/>y-tools%E7%9<wbr \/>A%84inotifyw<wbr \/>ait%E5%B7%A5<wbr \/>%E5%85%B7%E7<wbr \/>%94%A8exclud<wbr \/>e-%E5%92%8C-<wbr \/>fromfile-%E6<wbr \/>%8E%92%E9%99<wbr \/>%A4%E6%8C%87<wbr \/>%E5%AE%9A%E5<wbr \/>%90%8E%E7%BC<wbr \/>%80%E6%96%87<wbr \/>%E4%BB%B6\/<\/a><\/li>\n<li><a href=\"http:\/\/blog.chaiyalin.com\/2014\/02\/inotifywait-exclude.html\" target=\"_blank\">http:\/\/blog.<wbr \/>chaiyalin.co<wbr \/>m\/2014\/02\/in<wbr \/>otifywait-ex<wbr \/>clude.html<\/a><\/li>\n<\/ul>\n<\/div>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u5728Linux\u4e0b\u9700\u8981\u76d1\u63a7\u67d0\u4e2a\u6587\u4ef6\/\u76ee\u5f55\u7684\u53d8\u5316\u5e76\u8fdb\u884c\u901a\u77e5\uff0c\u5e38\u7528\u7684\u300ctail -f\u300d\u53ef\u4ee5\u5bf9\u6587 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,11,7,25,12],"tags":[83,620,30,8,601],"class_list":["post-2732","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-linux","category-programing","category-security","category-tools","tag-bash","tag-inotify","tag-linux","tag-python","tag-tail"],"views":7404,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=2732"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2732\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=2732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=2732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=2732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}