Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to purge the files that are older than 90 days
On 7 Sep 2006 09:18:05 -0700, "muddu" <mudassar.dba_at_gmail.com> wrote:
>Hi All ORA DBA's,
>
>I am in need of a unix shell script that will purge(clean up) all the
>files from history that are older than 90 days.
>
>Thanks
>Muddu.
This is standard Unix stuff, not DBA specific. Be very, very careful with this command.
find ./ -mtime +90 -exec rm {} \; -print
The above command deletes anything that hasn't been modified in the past 90 days in the current directory hierarchy. If you want a specific directory hierarchy, substitute that for the "./". For example...
find /home/oracle/personal -mtime +90 -exec rm {} \; -print
That command will delete everything under /home/oracle/personal that hasn't been modified in 90 days. Again, be very careful about where you run this command.
![]() |
![]() |