5 ms·
Even when you don't want less +F, a good alternative to tail -f is tail -F. It survives log rotation, and the file being temporarily inaccessible: --retry
by nothrabannosir 12y ago
Even when you don't want less +F, a good alternative to tail -f is tail -F. It survives log rotation, and the file being temporarily inaccessible:
--retry
keep trying to open a file even if it is inaccessible when tail
starts or if it becomes inaccessible later; useful when follow-
ing by name, i.e., with --follow=name
-F same as --follow=name --retry
- varikin 12y agoThis is my standard now. Logs rotate all the time and it very convenient to have tail continue working without my intervention.
- pimlottc 12y ago+1 for -F. Note that --follow and --retry are gnuisms, while -F works on most implementations of tail (even though it's not part of POSIX).
- fweespeech 12y agoYeah, tail -F is the way to go imo. Also, if you are using a proper ssh client, opening a second ssh connection to manage the reacting to the log files is habit for me at this point. The only time I'm using tail -F is after a new configuration deployment. Otherwise, I'm looking at archival data in ELK.
- noddingham 12y agoHave you tried using screen[1]? Might make things a little easier than have two separate SSH connections. [1] https://www.gnu.org/software/screen/ https://www.gnu.org/software/screen/
- baq 12y agoc.f. tmux
- fweespeech 12y agoYes. I use it when I need to resume a SSH session. Given proper configuration, switching SSH tabs/connections is as easy as switching browser tabs...there is no real need for me to use screen for such a purpose. Thank you for the suggestion tho. :)
- deleted 12y ago[deleted]
- protomyth 12y agoon OpenBSD -f does: Do not stop when end-of-file is reached, but rather to wait for additional data to be appended to the input. If the file is re- placed (i.e., the inode number changes), tail will reopen the file and continue. If the file is truncated, tail will reset its position to the beginning. This makes tail more useful for watching log files that may get rotated. The -f option is ig- nored if the standard input is a pipe, but not if it is a FIFO. So, no -F or --retry but a different default behavior
- acdha 12y agoIs there a bug report open for that yet? FreeBSD has this so they should be able to resync easily enough
- protomyth 12y agoI don't think its a bug
- oofabz 12y agoMe either, but bug reports are used for feature requests too, not only bugs.
- protomyth 12y agoand I don't think it needs a new set of flags since it, for me, does the right thing with -f currently.
- acdha 12y agoIf you want to be pedantic, no, it's not a bug but in the vast majority of the software world people use the term “bug tracker” to refer to a system which also tracks new work which isn't strictly a defect. And, since we're being pedantic, when I said “vast majority of the software world”, that includes the OpenBSD project: “Sending in bug reports If possible, use the sendbug(1) command to get the bug into our tracking system. Sendbug requires that your system can properly send Internet email. If you cannot use sendbug on a functional OpenBSD machine, please send your bug report to bugs@openbsd.org. Perhaps what you are sending in is a feature request, not necessarily a bug. New features are accepted, especially with code that implements your suggested new feature.” http://www.openbsd.org/report.html#bugtypes http://www.openbsd.org/report.html#bugtypes