tail new file
We have a process which generate logs, when log size reaches to a size limit, it start generating a new file.
Some operators are meant to monitor these logs continuously. We are using created a menu for operators to tail -f which display logs on the screen. But the problem is, after some time tail -f stops since log file changes. and operator needs to relogin to change the logs. Is their any way, which automatically change the log file, when it don't update for some time. |
Code:
eg: tail --follow=name /path/file2follow you'll see a message similar to the following $ tail --follow=name foo data line1 data line2 data line3 data line4 data line5 tail: foo: No such file or directory tail: `foo' has appeared; following end of new file data line6 ... |
But here file don't get renamed but new file generates with new name. we normally use ls -ltr | tail -n 1
|
have file moved, compressed. new file created, symlink to file.
look in /var/log, see how logs are moved, compressed. If you can either keep same name or use a symlink, the command I gave you will work |
All times are GMT -5. The time now is 08:08 AM. |