tail -f
will update the file once new data is inserted , but if the whole file is being rewritten it will give an error .
is there any other option to keep reloading the whole file ?
Thank you
man tail
gives :
tail -F
or tail --follow=name --retry
to keep tail watching file even if all the file is rewritten.
Have a look at multitail.
The following output was produced through the command sudo multitail --follow-all -i /vor/log/syslog
. It shows the end of one file, a notice that the file got truncated and the beginning of the new syslog entry:
Nov 8 09:06:36 rfc1178 anacron[22633]: Updated timestamp for job `cron.daily'11-08
tail: �~@~^/var/log/syslog�~@~\ wurde ersetzt; folge Ende der neuen Datei
----------- file got truncated /var/log/syslog 2012/11/08 09:08:02-----------
Nov 8 09:08:02 rfc1178 rsyslogd: [origin software="rsyslogd" …
-F
option, add the--retry
to the--follow=name
– Cédric Julien Nov 08 '12 at 08:44