10-22-2008
delete record
I have a log file , that keep the record of system activities , as below , now the log is appending so that it becomes very large .
"
05/01/08 Normal userA
05/01/08 Normal userB
05/02/08 Alnormal userC
"
"
10/01/08 Normal userA
10/02/08 Normal userA
"
Now I would like to keep the log current , so if the date is over 60 days , then remove this row , like above , the first three row should be removed as 05/01/08 and 05/02/08 is over 60 days ( today is 10/08/08 ) , can advise how to do it ? thx
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
Guys
I have downloaded a table from oracle database in .csv format. it has many fields as Title, First Name, Last Name etc. I have to download distinct titles from database and now i have to check all those titles from data of First Name one by one. and then i have to delete matched record.... (1 Reply)
Discussion started by: Rajeev Agrawal
1 Replies
2. UNIX for Dummies Questions & Answers
Hello all,
Is there a function for deleting a single record from a file?
Thanks in advance... (4 Replies)
Discussion started by: klafte
4 Replies
3. Shell Programming and Scripting
Hello!. I am working on a very simple program and I have been trying different things. This is so far what I have done and there is one small detail that still does not work. It finds all the records in a phonebook per say:
./rem Susan
More than one match; Please select the one to remove: ... (3 Replies)
Discussion started by: bartsimpsong
3 Replies
4. Shell Programming and Scripting
hi All,
need help...!!
I want to delete header record from all the files in current directory.
using sed command i can delete first record from a file but i want to delete first record from all the files so can anybosy help me how can i do this?
I will appreciate your help. (3 Replies)
Discussion started by: NirajThakar
3 Replies
5. Shell Programming and Scripting
Hi All,
I'm a newbie here, I'm just wondering on how to delete a single record in a large file in unix.
ex.
file1.txt is 1000 records
nikki1
nikki2
nikki3
what i want to do is delete the nikki2 record in file1.txt. is it possible?
Please advise,
Thanks, (3 Replies)
Discussion started by: nikki1200
3 Replies
6. Shell Programming and Scripting
Hi guys,
I have been given a small task to do and I am stuck already.
I have to format a file with people's emails address in it ready for pasting into the BCC section of an email.
The file looks like this:-
bob@ibm.com SMTP BOB SMITH text text text
sue@icl.org SMTP Susy Smith text text... (8 Replies)
Discussion started by: joe_evans
8 Replies
7. Linux
Hi all,
I want a perl program to delete the record and its contents from a file if there is no particular line in the record given that all records are separated by a blank line.
For example:
#100
abcd
efgh
hijk
123
klm
#200
abcd
efgh
hijk
klm
So, the pattern here is 123. If... (0 Replies)
Discussion started by: kaav06
0 Replies
8. Shell Programming and Scripting
Dear friend,
I have a file 2 files with column wise
FILE_A
------------------------------
x,1,@
y,3,$
x,5,%
FILE_B
--------------------
x,1,@
i like to delete the all lines in FILE_A ,if first column available in FILE_B.
output (in FILE_A)
y,3,$
x,5,% (10 Replies)
Discussion started by: Jewel
10 Replies
9. Shell Programming and Scripting
Sample file record :
"20130617003","2013-06-18T07:00:03","OUTWARD","01001011","TEST PLC","","HFX834346364364","20130617","10","DUM87534758","","1.28","826","020201","65879278","","","","","","010101","56789","DUMMY... (3 Replies)
Discussion started by: bigbuk
3 Replies
10. Shell Programming and Scripting
Hi,
i have another problem. I have been trying to solve it by myself but failed.
inputfile
;;
ID T08578
NAME T08578
SBASE 30696
EBASE 32083
TYPE P
func just test
func chronology
func cholesterol
func null
INT 30765-37333
INT 37154-37318
Link 5546
Link 8142 (4 Replies)
Discussion started by: redse171
4 Replies
LEARN ABOUT SUSE
xfs_logprint
xfs_logprint(8) System Manager's Manual xfs_logprint(8)
NAME
xfs_logprint - print the log of an XFS filesystem
SYNOPSIS
xfs_logprint [ options ] device
DESCRIPTION
xfs_logprint prints the log of an XFS filesystem (see xfs(5)). The device argument is the pathname of the partition or logical volume con-
taining the filesystem. The device can be a regular file if the -f option is used. The contents of the filesystem remain undisturbed.
There are two major modes of operation in xfs_logprint.
One mode is better for filesystem operation debugging. It is called the transactional view and is enabled through the -t option. The
transactional view prints only the portion of the log that pertains to recovery. In other words, it prints out complete transactions
between the tail and the head. This view tries to display each transaction without regard to how they are split across log records.
The second mode starts printing out information from the beginning of the log. Some error blocks might print out in the beginning because
the last log record usually overlaps the oldest log record. A message is printed when the physical end of the log is reached and when the
logical end of the log is reached. A log record view is displayed one record at a time. Transactions that span log records may not be
decoded fully.
OPTIONS
-b Extract and print buffer information. Only used in transactional view.
-c Attempt to continue when an error is detected.
-C filename
Copy the log from the filesystem to the file filename. The log itself is not printed.
-d Dump the log from front to end, printing where each log record is located on disk.
-D Do not decode anything; just print data.
-e Exit when an error is found in the log. Normally, xfs_logprint tries to continue and unwind from bad logs. However, sometimes it
just dies in bad ways. Using this option prevents core dumps.
-f Specifies that the filesystem image to be processed is stored in a regular file at device (see the mkfs.xfs(8) -d file option).
This might happen if an image copy of a filesystem has been made into an ordinary file with xfs_copy(8).
-l logdev
External log device. Only for those filesystems which use an external log.
-i Extract and print inode information. Only used in transactional view.
-q Extract and print quota information. Only used in transactional view.
-n Do not try and interpret log data; just interpret log header information.
-o Also print buffer data in hex. Normally, buffer data is just decoded, so better information can be printed.
-s start-block
Override any notion of where to start printing.
-t Print out the transactional view.
SEE ALSO
mkfs.xfs(8), mount(8).
xfs_logprint(8)