List last 10 Hrs file and find error files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting List last 10 Hrs file and find error files
# 8  
Old 02-10-2010
Hi,

File name are similar like "tSA_5_1521755992" it means log of Service 5 .. No time stamp but inside the log file there is a time stamp like...
Code:
"_BNK/SYSTEM.END.OF.DAY5_REVALUATION.AL_7_30 JAN 2010_13:26:49_SELECT F.JOB.LIST.12 SAMPLE 100000 Selected=36 tim
092981 _BNK/SYSTEM.END.OF.DAY5_REVALUATION.AL_7_30 JAN 2010_13:26:49_Processing...36 Offset...13 Number of sessions...1
092982 ..... ** Error [ EXIT_TRANS_ABORT ] **
092983 TRANSACTION ABORT forced as transaction open when program terminated

this is the way u can track time but my concern is files inside log dir are too much as i told earlier that 200 Files per min and i need last 6 hrs list of those files which have "error" inside the log files.

Last edited by Scott; 02-10-2010 at 07:26 AM.. Reason: Code tags
# 9  
Old 02-13-2010
Hi,

No time stamp in File Name
# 10  
Old 02-13-2010
Hence using thr modification time of the files using find, e.g.:
Code:
find -type f -cmin -600 -exec grep Error {} \;

If your operation system's copy of find does not support -cmin then you'll have to use -mtime in days instead.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find list of missing files based on the file format?

Hi All, In the file names we have dates. Based on the file format given by the user, if any file is not existed for a particular date with in a given interval we should consider that file is missing. I have the below files in the directory /bin/daily/voda_files. ... (9 Replies)
Discussion started by: nalu
9 Replies

2. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies

3. Shell Programming and Scripting

finding files N hrs old

I know you can supply the find command with an option to find files > than N days old. Is there some way to do this to find files that are > than N hours old. I want to do somthing like this: find . -mtime + (now - 2hrs) -print If not is there a way to do this with sed or awk or some... (5 Replies)
Discussion started by: BeefStu
5 Replies

4. Shell Programming and Scripting

To delete files older than 24 hrs

I have to retain only 1 day files in my system an I have to delete all the other files which are older than 24 hrs. Please let me know the option I have to give in the find -mtime command. (3 Replies)
Discussion started by: rajesh8s
3 Replies

5. Shell Programming and Scripting

Want to find the stdout for the partiuclar user login for past 12 hrs.

Want to find the stdout for the partiuclar user login for past 12 hrs. Say for eg : user login id is teladm And the host name is sys22prod I want to see the stdout for that user id in that host for past 12 hrs (1 Reply)
Discussion started by: mail2sant
1 Replies

6. Shell Programming and Scripting

find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following: I have a list of filenames: A01_155716 A05_155780 A07_155812 A09_155844 A11_155876 that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies

7. Shell Programming and Scripting

Find files in a directory which are older than 2 hrs

hi all, I need to find files in a directory which are older than N hrs... n can be 1,2,3,.. etc when tried using -mtime option it gives all the files in the last 24hrs from the current time . please help me out on this .. thanks (8 Replies)
Discussion started by: sparks
8 Replies

8. UNIX for Dummies Questions & Answers

How to list files Created in last 2 hrs

I wanted to know what command should I use to see the files created in last 2 hours in a given directory. I know to see the files changed in last one day I can use this: find /admin//dump -type f -ctime -1 -print | xargs ls -lt|pg However I am not getting what should I use if I wanted tol... (4 Replies)
Discussion started by: rsonakiya
4 Replies

9. Shell Programming and Scripting

check for new file over 24 hrs

Hi all, I am trying to figure out a method to flag an error if a file has not arrived in a certain directory within 24 hrs of the last one arriving. I am currently writing the time to a file when a file is recieved. I then want to check for a new file reguarly but flag an error if it has been... (3 Replies)
Discussion started by: pxy2d1
3 Replies

10. Shell Programming and Scripting

modifying grep to get files only within last 2 hrs

Hi gurus I am currently using the below mentioned grep to find timestamp of last generated log file. touch -t $time_search dummy ecust_time_stamp=$(find . -name 'eCustomerCME*' -newer dummy -type f -exec ls -ltr {} \; | tail -1 | awk ' { print $6,$7,$8 } ') I calculate... (3 Replies)
Discussion started by: ragha81
3 Replies
Login or Register to Ask a Question