Alternative to tail -n -0 -F for monitoring live log file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Alternative to tail -n -0 -F for monitoring live log file
# 8  
Old 08-19-2015
Most of what is in your latest script seems to be an attempt to either obfuscate the intent of the script or to slow down execution of your script, or both.
Please show us the output of the following commands:
Code:
head "/opt/All/Meta/CableData/logs/meta_all//Server.log" | tee /tmp/log.$$ | od -bc
cat /tmp/log.$$
rm -f /tmp/log.$$

And show us the exact output produced by your latest script (including diagnostic messages).

(And, please use CODE tags when showing us the output.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Monitoring script for Log file

Hi, Iam new to unix , plz help me to write below script. I need to write a script for Monitoring log file when any error occurs it has to send a mail to specified users and it should be always pick latest error not the existing one and the script should be able to send mail all errors (more... (1 Reply)
Discussion started by: vij05
1 Replies

2. Shell Programming and Scripting

Monitoring script for a log file

Hi, I need to get a script working to monitor a log file and throw an alert via mailx as soon as a particular error is encountered. I do not want repeatative email notifications of same error so simply cat logfile and grepping the error would not work. Here is what i planned but it seems... (2 Replies)
Discussion started by: roshan.171188
2 Replies

3. Shell Programming and Scripting

How to process only new line of tail -f command from live log file?

Hi, I want to read a live log file line by line and considering those line which are newly added to file Below code I am using, which read line but as soon as it read new line from log file its starts processing from very first line of file. tail -F /logs/COMMON-ERROR.log | while read... (11 Replies)
Discussion started by: ketanraut
11 Replies

4. Shell Programming and Scripting

How to tail -f logfile. if log file is generate every 1 HR.?

Hello, How to tail -f logfile. if log file is gennerate every 1 HR. I want it works automatically all the time. never changes it by manual. Thank ls -trl CybertonTransaction.* -rw-r--r-- 1 autobot robot 617071 Jul 9 00:02 CybertonTransaction.20130709-00.log -rw-r--r-- 1 autobot ... (12 Replies)
Discussion started by: ooilinlove
12 Replies

5. Shell Programming and Scripting

Piping tail to awk to parse a log file

Hello all, I've got what I'm pretty sure is a simple problem, but I just can't seem to work past it. I'm trying to use awk to pretty up a log file, and calculate a percentage. The log file looks like this: # tail strtovrUsage 20090531-18:15:45 RSreq - 24, RSsuc - 24, RSrun - 78, RSerr -... (4 Replies)
Discussion started by: DeCoTwc
4 Replies

6. Shell Programming and Scripting

Monitoring log file

Hi, I ned to monitor the tomcat log file called "catalina.out" for "Out of memory" error. the script should monitor this file and send us the mail as soon as it finds the string "Out of memory" in the file. can ypu suggest me which is the best way to do this? (4 Replies)
Discussion started by: shivanete
4 Replies

7. Shell Programming and Scripting

how to tail a log file..

Hi All.. I have a log file in which all the backup information is stored. Now i have written a script which get the last line in the backup log file.. ssh -l ora${sid} ${primaryhost} "tail -1 /oracle/$ORACLE_SID/sapbackup/back$ORACLE_SID.log" However i would like to tail the line last... (4 Replies)
Discussion started by: suri.tyson
4 Replies

8. Shell Programming and Scripting

tail -f monitoring

Is there any file on UNIX that changes periodically so that I could use tail -f command to watch changes? I was searching a long time and I didn't find nothing (I'm newbie to UNIX so it's not a surprise to me though) Thanks for help :) (6 Replies)
Discussion started by: MartyIX
6 Replies

9. Shell Programming and Scripting

Bash tail monitor log file

Hi there, I have a problem here that involves bash script since I was noob in that field. Recently, I have to monitor data involve in logs so I just run command tail -f for the monitoring. The logs was generate every hour so I need to quickly change my logs every time the new hour hits according... (2 Replies)
Discussion started by: kriezo
2 Replies

10. Shell Programming and Scripting

tail -f a log file redirected into a new window?

Is this possible? I am attempting to display a new xterm window and tail -f the log file within that new window. I am currently working on a solaris 8 machine if that has any different meaning than the other platforms. As you can see, I am a newbie to this forum and to UNIX. Any help would be... (2 Replies)
Discussion started by: douknownam
2 Replies
Login or Register to Ask a Question
TAIL(1) 						    BSD General Commands Manual 						   TAIL(1)

NAME
tail -- display the last part of a file SYNOPSIS
tail [-F | -f | -r] [-q] [-b number | -c number | -n number] [file ...] DESCRIPTION
The tail utility displays the contents of file or, by default, its standard input, to the standard output. The display begins at a byte, line or 512-byte block location in the input. Numbers having a leading plus ('+') sign are relative to the beginning of the input, for example, ``-c +2'' starts the display at the second byte of the input. Numbers having a leading minus ('-') sign or no explicit sign are relative to the end of the input, for example, ``-n 2'' displays the last two lines of the input. The default start- ing location is ``-n 10'', or the last 10 lines of the input. The options are as follows: -b number The location is number 512-byte blocks. -c number The location is number bytes. -f The -f option causes tail to not stop when end of file is reached, but rather to wait for additional data to be appended to the input. The -f option is ignored if the standard input is a pipe, but not if it is a FIFO. -F The -F option implies the -f option, but tail will also check to see if the file being followed has been renamed or rotated. The file is closed and reopened when tail detects that the filename being read from has a new inode number. If the file being followed does not (yet) exist or if it is removed, tail will keep looking and will display the file from the begin- ning if and when it is created. The -F option is the same as the -f option if reading from standard input rather than a file. -n number The location is number lines. -q Suppresses printing of headers when multiple files are being examined. -r The -r option causes the input to be displayed in reverse order, by line. Additionally, this option changes the meaning of the -b, -c and -n options. When the -r option is specified, these options specify the number of bytes, lines or 512-byte blocks to display, instead of the bytes, lines or blocks from the beginning or end of the input from which to begin the display. The default for the -r option is to display all of the input. If more than a single file is specified, each file is preceded by a header consisting of the string ``==> XXX <=='' where XXX is the name of the file unless -q flag is specified. EXIT STATUS
The tail utility exits 0 on success, and >0 if an error occurs. EXAMPLES
To display the last 500 lines of the file foo: $ tail -n 500 foo Keep /var/log/messages open, displaying to the standard output anything appended to the file: $ tail -f /var/log/messages SEE ALSO
cat(1), head(1), sed(1) STANDARDS
The tail utility is expected to be a superset of the IEEE Std 1003.2-1992 (``POSIX.2'') specification. In particular, the -F, -b and -r options are extensions to that standard. The historic command line syntax of tail is supported by this implementation. The only difference between this implementation and historic versions of tail, once the command line syntax translation has been done, is that the -b, -c and -n options modify the -r option, i.e., ``-r -c 4'' displays the last 4 characters of the last line of the input, while the historic tail (using the historic syntax ``-4cr'') would ignore the -c option and display the last 4 lines of the input. HISTORY
A tail command appeared in PWB UNIX. BSD
March 16, 2013 BSD