We're using tail to continuously monitor several logs, but when a log is rotated the tail for that file will cease.
As far as I understand, the problem is that when the log is rotated, there is a new file created, and the running tail process doesn't know anything about that new file handle.
Best Answer
Ah, there's a flag for this.
instead of using
tail -f /var/log/file
we should be usingtail -F /var/log/file
tail -F
translates totail --follow=name --retry
as in;--follow=name
: follow the name of the file instead of the file descriptor--retry
: if the file is inaccessible, try again later instead of dying