Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

maybe a buffer issue?

Status
Not open for further replies.

troythered

Technical User
Apr 2, 2009
19
US
Our database has a binary file that is appended to for account notes. I am trying to see the notes in realtime as they are entered.

I use the following command which works fine:
tail /program/log/note.log | strings -n 3
However I have to enter that command to update my screen...

tail -f /program/log/note.log | strings -n 3
The above line does not update the screen in real time.

watch -n 5 tail /program/log/note.log | strings -n 3
The above command skews the data across the screen in a very bad way.

I found which mentions the programs unbuffer, stdbuf, and using less, however this file is 1.7G large and less has to scroll through the entire 1.7G over a 100mbit network to get to the end...

Any suggestions? I cannot find debian packages containing stdbuf or unbuffer, but if those are my only options I guess I could find them and include them if I have to.
 
BAH someone reminded me "tail" processes by the line, and this binary file would have long "lines" in it, if any at all...

Sooo, I guess I'm back to figuring out another way to do what I want. If anyone has any suggestions I am willing to try anything. It's not important, I just like a challenge.

 
On my linux servers, the option -c changes the default of tail from lines to bytes. If the same option is availably for you, using it would be a first attempt to getting more readable output.
 
Karluk, thank you for pointing that out, it helps me look for notes placed placed that day, but hours before. It helps.


I discovered that I need to use:
tail -s 5 -f /program/log/note.log | strings -n 3

-s is for "sleep" and 5 seconds, it executes every 5 seconds showing me the last things entered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top