http://flume.apache.org/FlumeUserGuide.html
flume抓取 exec 的command 官網有如下建議:
以下內容來自:http://blog.163.com/yinlong_bgp/blog/static/21733277201031503321806/
tail -f,當文件被刪除或移走后,即使重新創建的文件也不會再出現新文件內容。如下
(第一個窗口)
[root@cftest2 ~]# tail -f messages.3
helll test2
(第二個窗口)
[root@cftest2 ~]# rm messages.3
rm: remove regular file `messages.3'? y
[root@cftest2 ~]# echo "helll test3">>messages.3
但是第一個窗口的tail -f 命令不會出現 hello test3
tai -F :當文件刪除或者移走后仍然追蹤此文件,此時重新創建文件,會繼續顯示內容:
[root@cftest2 ~]# tail -F messages.3
helll test1
tail: `messages.3' has become inaccessible: No such file or directory
tail: `messages.3' has appeared; following end of new file
helll test2
可以看到,中間刪除了messages.3,但重新創建后並輸入helll test2,會繼續顯示出來。