Operating System - HP-UX
1748259 Members
3473 Online
108760 Solutions
New Discussion юеВ

Re: Deleting files oler than 20 minutes

 
SOLVED
Go to solution
Arturo Galbiati
Esteemed Contributor

Re: Deleting files oler than 20 minutes

Hi Salman,
all the above solution are fine for your problem, but you have to be sure tht the log file you are trying to move is not really in use by the database.
I suggest you to include in your script some Oracle command to shiwtch the log file in use (in sorry but now I don't rememeber those). IN this way you are sure that file older than 'x' min is really not in use.
Just my .02$.

HTH,
Art
likid0
Honored Contributor

Re: Deleting files oler than 20 minutes

Hy,

just wanted to leave you the zsh line for what you need:

ls -ltr **/*(.mm+15)


Windows?, no thanks
likid0
Honored Contributor

Re: Deleting files oler than 20 minutes

Ops sorry you actually wanted to delete them:

If files, dirs and subdirs then:
rm -Rf **/*(.mm+15)
If only files:
rm -f *(.mm+15)
Windows?, no thanks
OldSchool
Honored Contributor

Re: Deleting files oler than 20 minutes

I saw "move", but the above deletes.....
James R. Ferguson
Acclaimed Contributor

Re: Deleting files oler than 20 minutes

Hi:

> OldShool: I saw "move", but the above deletes.....

Well, not mine, the code even says "move" :-))

Regards!

...JRF...
OldSchool
Honored Contributor

Re: Deleting files oler than 20 minutes

seems to be that fuser might suffice to check if one of the files you want to move is open, rather than assuming that at some fixed point in time that its done.

or, as one of the other posters noted, force oracle to switch archives. in such a case, build the list first, switch the file, then process everything in the list