Home » Infrastructure » Linux » How to delete files by "created date"
How to delete files by "created date" [message #201640] Mon, 06 November 2006 03:15 Go to next message
taboo168
Messages: 4
Registered: November 2006
Location: Hanoi, Vietnam
Junior Member

Hi all,

I'm running Oracle DB9i on Linux AS4.0, using archive log mode. So If I dont remove archived log files manually, server HDDs will be full after weeks.
And now I try to fingure out "how to delete files by created date" to manage archived log files.
Any help will be highly appriciate!
Hungnh
Re: How to delete files by "created date" [message #201649 is a reply to message #201640] Mon, 06 November 2006 03:35 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmbackp.htm#456279
Use
RMAN> backup archivelog ...your options..
or
write a unix script that will use
'find' with mtime or atime.
schedule the script to run everday.

Search the forum for more examples.
Re: How to delete files by "created date" [message #201653 is a reply to message #201640] Mon, 06 November 2006 03:51 Go to previous messageGo to next message
taboo168
Messages: 4
Registered: November 2006
Location: Hanoi, Vietnam
Junior Member

Thanks very much Mahesh Rajendran, but I still miss the answer because I'm not good at Linux command at all. I can find those files with "find -mtime", but dont know how to remove them. So can you please provide an simple example.
Thanks in advance
Hungnh
Re: How to delete files by "created date" [message #201655 is a reply to message #201653] Mon, 06 November 2006 03:55 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
I asked
>>Search the forum for more examples.
Did you even try that?

find <path> -type f -name "*.ext" -mtime +<your_retention> -exec rm {} \;


PS: above is untested code.

[Updated on: Mon, 06 November 2006 03:58]

Report message to a moderator

Re: How to delete files by "created date" [message #201659 is a reply to message #201640] Mon, 06 November 2006 04:00 Go to previous message
taboo168
Messages: 4
Registered: November 2006
Location: Hanoi, Vietnam
Junior Member

It's done Very Happy
Thanks alot
Hungnh
Previous Topic: concurrent manager error
Next Topic: Taking Backup After 15 minutes
Goto Forum:
  


Current Time: Fri Dec 09 04:24:40 CST 2016

Total time taken to generate the page: 0.15532 seconds