Sponsored Content
Top Forums Shell Programming and Scripting How to tail real time file Generated every hour? Post 302632051 by ooilinlove on Saturday 28th of April 2012 11:43:25 PM
Old 04-29-2012
How to tail real time file Generated every hour?

Hi Guys,

I am developing a script to monitor log file Generated every hour.
When creating a new file scripts not working.

My Code . I want to monitor GatewayTransaction.yyyymmdd-hh.log
Code:
while true; do newdate=$(date '+%Y%m%d') ; nowdate=$(date '+%Y%m%d-%H.log'); tail -f /usr/home/ABCD/atimo/log/$newdate/option/OP2/GatewayTransaction.$nowdate ;sleep 5 ; done ;

Ex Log name
Code:
-rw-r--r--   1 bewio   adlioj   85730700 Apr 29 08:59 GatewayTransaction.20120429-08.log
-rw-r--r--   1 bewio   adlioj   13162747 Apr 29 09:59 GatewayDR.20120429-09.log
-rw-r--r--   1 bewio   adlioj   45739723 Apr 29 09:59 GatewayTransaction.20120429-09.log
-rw-r--r--   1 bewio   adlioj     25650 Apr 29 10:31 GatewayException.20120429.log
-rw-r--r--   1 bewio   adlioj      1741 Apr 29 10:31 GatewayNegativeResponse.20120429.log
-rw-r--r--   1 bewio   adlioj    195235 Apr 29 10:36 GatewayCIMDDebug.20120429-10.log
-rw-r--r--   1 bewio   adlioj   11630362 Apr 29 10:36 GatewaySMPPDebug.20120429-10.log
-rw-r--r--   1 bewio   adlioj   17897250 Apr 29 10:36 GatewayDR.20120429-10.log
-rw-r--r--   1 bewio   adlioj   73384961 Apr 29 10:36 GatewayTransaction.20120429-10.log


Please Help me or guide line.

Last edited by fpmurphy; 04-30-2012 at 12:50 AM.. Reason: removed large font
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Real time log file redirect

Hi all, i would like to write the shell script program, it can monitor the access_log "real time" when the access_log writing the line contain "abcdef" the program will be "COPY" this line into a file named "abcdef.txt", do the same thing if the contain "123456" "COPY" it into a file named... (3 Replies)
Discussion started by: eric_wong_ch
3 Replies

2. UNIX for Dummies Questions & Answers

Live/real-time text-file updates in terminal

I want to have a terminal open and have something like a "repeating cat" command running in it for a certain text file (in particular /var/log/system.log). So my terminal will scan or cat the text file every so often or whenever the text file system.log gets written to by the system, it will... (1 Reply)
Discussion started by: guitarscn
1 Replies

3. Shell Programming and Scripting

How to tail -f real time file.

How to tail -f real time file. I want to tail file created last time. The server is gen new file Always. . An example file. -rw-r--r-- 1 shinnie tiituck 251M Oct 18 05:39 20111018_00.log -rw-r--r-- 1 shinnie tiituck 251M Oct 18 11:18 20111018_01.log -rw-r--r-- 1 shinnie tiituck... (3 Replies)
Discussion started by: ooilinlove
3 Replies

4. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

5. Shell Programming and Scripting

How to pick only the files which are generated in one hour?

Hello Masters, I need one help. I want to copy the files which are continuously generating on one server. But this would be on hourly basis. e.g. -rw-rw-r-- 1 akore akore 0 Feb 12 03:20 test1.log -rw-rw-r-- 1 akore akore 0 Feb 12 03:42 test2.log -rw-rw-r-- 1 akore akore 0 Feb 12 04:22... (2 Replies)
Discussion started by: akore83
2 Replies

6. Shell Programming and Scripting

How do i use tail & grep in real time here??

Hi I have a file which is updated very frequently. Where in i wanted to use tail -f command in the script and wanted to grep for a particular word. But the issue is when i use tail -f filename|grep "word" ... it will show me blank until the word is found in the real time. if it shows... (13 Replies)
Discussion started by: nikhil jain
13 Replies

7. Shell Programming and Scripting

Grep in a log file within a time range (hour)

Hi, im trying to write a grep script that returns me the last inputs added in the last hour in the log file. Literally i have nothing yet but: grep 'Line im looking for' LOGFILE.log | tail -1 this only gives me the last input, but no necessarily from the last hour. Help Please. (4 Replies)
Discussion started by: blacksteel1988
4 Replies

8. Shell Programming and Scripting

Archiving or removing few data from log file in real time

Hi, I have a log file that gets updated every second. Currently the size has grown to 20+ GB. I need to have a command/script, that will try to get the actual size of the file and will remove 50% of the data that are in the log file. I don't mind removing the data as the size has grown to huge... (8 Replies)
Discussion started by: Souvik Patra
8 Replies
SVK::Log::Filter::XML(3)				User Contributed Perl Documentation				  SVK::Log::Filter::XML(3)

NAME
SVK::Log::Filter::XML - display log messages in XML format SYNOPSIS
> svk log --xml <?xml version="1.0" encoding="utf-8"?> <log> <logentry revision="1234" original="456"> <author>author</author> <date>2006-05-16T15:43:28.889532Z</date> <msg>This is the commit message for the revision.</msg> </logentry> </log> > svk log --output xml ... DESCRIPTION
The XML filter is an output filter for displaying log messages in XML format. The organization of the XML format should be self- explanatory after a little experimentation. The format is designed to be compatible with Subversion's XML output, so you should be able to use tools like <http://ch.tudelft.nl/~arthur/svn2cl/> without any modification. However, since SVK supports arbitary log filters (see SVK::Log::Filter for details on writing one), it may be easier to write your own output format than to process the XML. This filter is invoked implicitly when you specify the "--xml" argument to SVK's log command. Two arguments to the log command modify XML's behavior. quiet Providing this command-line option to the log command prevents the XML filter from displaying the contents of the log message. All other information is displayed as usual. verbose Providing this command-line option to the log command makes the XML filter display history information for each revision. The history includes the kind of modification (modify, add, delete) and any copy history for each path that was modified in the revision. STASH
/PROPERTY MODIFICATIONS XML leaves all properties and the stash intact. perl v5.10.0 2008-08-04 SVK::Log::Filter::XML(3)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy