GNU tail lets you say "--follow=descriptor" to follow the content of the file no matter how it gets renamed, or "--follow=name" to re-open the same filename when a different file gets renamed onto it.
Re:Files Are Hard
by daurnimator on Sunday December 13, 2015 @07:06AM
(#10726138)
That's the difference between 'tail -f' and 'tail -F' and is implemented in every tail I know of.
indeed. `tail -qF` has been muscle memory for me for as long as I can remember.
if you have long lived sessions tail'ing logs that get rotated (or truncated), forgetting -F is a good way to eventually end up confused, ctrl-c'ing, and finally cursing.
[0] Here's follow(1) in my homemade PL: