1827808 Members
2854 Online
109969 Solutions
New Discussion

Re: Looking for a script

 
SOLVED
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...

/oracle/app/logs/

Thanks and points will be assigned.
2 REPLIES 2
Ivan Ferreira
Honored Contributor
Solution

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.