I am using tail with option --follow=name
to watch my log files in my servicemix instance (path = ${smx_home}/data/log/servicemix.log
).
ServiceMix have a 'nice' feature to restart clean with servicemix clean
that start fresh without cache and it seems it removes also the whole directory ${smx_home}/data.
When the folder and the log file are deleted, the message comes:
tail: data/log/servicemix.log: No such file or directory
and I have to press ctrl-C and restart my tail command like
tail --follow=name data/log/servicemix.log
The issue comes because the 'clean start' of ServiceMix remove the whole directory and not only the file and the initial inode is invalid.
Is there any way to make tail to reconnect to the deleted log?
If tail does not work, is there any other alternative (like e.g. with more
or less
)?
UPDATE:
I also tested multiple combination with -F
--follow
and --retry
tail --follow=name --retry data/log/servicemix.log
and this is not working too.
My tail version is
tail (GNU coreutils) 8.4
-F
works just fine on new directories.