Showing results for 
Search instead for 
Did you mean: 

Looking for a script

Go to solution
Ragni Singh
Super Advisor

Looking for a script

Hello, I need to find a script that will do the following...

Delete files that are a week or older from the following place...


Thanks and points will be assigned.
Ivan Ferreira
Honored Contributor

Re: Looking for a script

You just need to use the find command:

find /oracle/app/logs -type f -mtime +7 -exec rm {} \;

The -mtime +7 means files older than 7 days, and -exec rm {} execute the action.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ragni Singh
Super Advisor

Re: Looking for a script

Thank you Ivan, I was having brain cramps. You get 10 points.