Patricia,
It is better if this command is run as a background process as:
nohup rm `ls -ltr arch*.arc|grep "Mar 26"|cut -c(use correct column start
line number here)-99` &
Thanks
Jay
-----Original Message-----
From: Jay Sethi [mailto:jay.[Email Address Removed] Wednesday, March 31, 2004 2:22 PM
To: Patricia Phung; LazyDBA.com Discussion
Subject: RE: Easy way to delete archived logs from old date
Patricia,
Try the following:
1. Go to the arch directory.
2. Try the following to find the column number of the arch file names in the
ls -l command.
ls -ltr arch*.arc|grep "Mar 26"|cut -c55-99
I have used 55, check and change.
3. rm `ls -ltr arch*.arc|grep "Mar 26"|cut -c(use correct columsn start line
number here)-99`
This Works.
jay
-----Original Message-----
From: Patricia Phung [mailto:Patricia.[Email Address Removed] Wednesday, March 31, 2004 2:03 PM
To: LazyDBA.com Discussion
Subject: RE: Easy way to delete archived logs from old date
Hello,
I need to delete the archived logs from March 26. Is there Unix quick
command that will wipe out all the files at once that match that specific
date. Here is a sample of the listing ls -ltr
-rw-rw---- 1 oracle dba 104857600 Mar 26 07:53 arch0000055495.arc
-rw-rw---- 1 oracle dba 104858112 Mar 26 07:56 arch0000055496.arc
-rw-rw---- 1 oracle dba 104858112 Mar 26 08:19 arch0000055497.arc
-rw-rw---- 1 oracle dba 104858112 Mar 26 08:44 arch0000055498.arc
-rw-rw---- 1 oracle dba 104858112 Mar 26 09:11 arch0000055499.arc
-rw-rw---- 1 oracle dba 104858112 Mar 26 10:33 arch0000055500.arc
-rw-rw---- 1 oracle dba 104858112 Mar 26 10:44 arch0000055501.arc
-rw-rw---- 1 oracle dba 104858112 Mar 26 11:03 arch0000055502.arc
Thanks for your help.
Patricia
--------
Get today's cartoon: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: send a blank email to oracledba-[Email Address Removed] subscribe: send a blank email to oracledba-[Email Address Removed] using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page