I have a log file in format log_name_YY-MM-DD_HH_mm.log
. The log rotates every couple of hours and the new log is created containing the date and time of it's creation. Sometimes I need to tail the live output of this log with the tail -f
command. After the log is rotated tail still points to old filename and must be manually restarted with the new filename.
Is there a way to automatically switch tail -f
to use the new file? The tail -F
option (tail --follow=name --retry
) doesn't work in this case because the filename of the log changes.