tail follow file logrotate

Revision history
Tags: tail logrotate linux

On one of my servers I was running tail -f /var/log/nginx/error.log. But output would stop every so often since the file is rotated with logrotate, giving that path a new inode number.

So when I switched to tail -F, I no longer have to restart the tail process to make it follow the output again.

Documentation excerpt

-f --follow
    output appended data as the file grows
-F
    same as --follow=name --retry
--retry
    keep trying to open a file if it is inaccessible

References

If you have any comments or feedback, please send me an e-mail. (stig at stigok dotcom).

Did you find any typos, incorrect information, or have something to add? Then please propose a change to this post.

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.