0xC*_*22L 3 logs tail multitail
对于logrotate
d 文件,通常使用tail -F
而不是tail -f
跟踪日志文件内容。是否multitail(1)
自动跟随名称而不是 inode(这可能会随着日志轮换而改变)?
我筛选了文档并在网上搜索,但无法得出结论性的答案。
感谢接受的答案,我发现该man
页面确实提到了我想要的选项,但使用术语“描述符”而不是“索引节点”。所以这个问题和答案应该是下一个人研究这个话题的粘合剂。
-f Follow the following filename, not the descriptor.
--follow-all
For all files after this switch: follow the following filename, not the descriptor.
Run Code Online (Sandbox Code Playgroud)
根据multitail
手册:
There are a few other options not fitting elsewhere, these are:
-f This makes MultiTail follow the file. In case the original file gets
renamed and a new file is created with the original filename, MultiTail
will start watching the file with the original filename (the one you
entered).
Run Code Online (Sandbox Code Playgroud)
对我来说,这意味着默认情况下它跟在inode
/ 文件描述符而不是文件名之后。
对来源的粗略阅读证明了这一点。在exec.c:79
中,follow_filename
VAR(以设置cmdline.c:889
或ui.c:966
定义的后续通过文件名标志(是否)-F
,--follow=name
等)被传递到tail
。