Re: OT: find command on rhel4 not working with mtime
- From: "Stefan Knecht" <knecht.stefan@xxxxxxxxx>
- To: "Mark Brinsmead" <pythianbrinsmead@xxxxxxxxx>
- Date: Tue, 11 Jul 2006 07:35:56 +0200
Errrrr... of course switch the order of the -name and -mtime args, not the
-exec .... figured that was obvious
Stefan
On 7/11/06, Mark Brinsmead <pythianbrinsmead@xxxxxxxxx> wrote:
Oh! Bad advice!
Sure, delete the files *first*, *then* check to see whether the date
criteria is met.
It will "work", but it won't do what you wanted...
In general, you need to prefix the "*" in your find command with a "\",
however,
your use of double-quotes *should* achieve the same end. All the same,
why don't
you try?
On 7/10/06, Stefan Knecht < knecht.stefan@xxxxxxxxx> wrote:
>
> I've been having some odd issues with find where the order of the
> filters mattered.
>
> try to put -mtime before -name and see if that helps
>
> Stefan
>
>
>
>
> On 7/8/06, Steve Perry <sperry@xxxxxxxxxxx> wrote:
> >
> > Didn't know if anyone else has run across this, but I spent 1.5 hours
> > trying to get a tried and true find command to work on RHEL4 (32-bit)
> > without success.
> >
> > I wanted to delete the audit files in $ORACLE_BASE/admin/<SID>/
> > adump that were older than 60 days. It shouldn't be rocket science
> > or so I thought.
> >
> > the command was
> >
> > find $ORACLE_BASE/admin/<SID>/adump -name "ora*.aud" -mtime +60
> >
> > It was supposed to have " -exec rm {} \;", but I never got that far
> > because it wouldn't return any files.
> >
> > i could use -60 and it would return files less than 60 days, but "+"
> > failed to return anything. I tried ctime as well, but nothing.
> > man and google didn't return anything.
> >
> > Anybody run across this before?
> > I thought I'd ask before writing a perl script. Does anyone have any
> > one-line perl scripts before I write a longer one?
> >
> > Thanks,
> > steve
> > --
> > http://www.freelists.org/webpage/oracle-l
> >
> >
> >
>
--
Cheers,
-- Mark Brinsmead
Staff DBA,
The Pythian Group
http://www.pythian.com/blogs
- Follow-Ups:
- Re: OT: find command on rhel4 not working with mtime
- From: Mark Brinsmead
- References:
- OT: find command on rhel4 not working with mtime
- From: Steve Perry
- Re: OT: find command on rhel4 not working with mtime
- From: Stefan Knecht
- Re: OT: find command on rhel4 not working with mtime
- From: Mark Brinsmead
Other related posts:
- » OT: find command on rhel4 not working with mtime
- » Re: OT: find command on rhel4 not working with mtime
- » Re: OT: find command on rhel4 not working with mtime
- » Re: OT: find command on rhel4 not working with mtime
- » Re: OT: find command on rhel4 not working with mtime
- » Re: OT: find command on rhel4 not working with mtime
Oh! Bad advice!
Sure, delete the files *first*, *then* check to see whether the date criteria is met. It will "work", but it won't do what you wanted...
In general, you need to prefix the "*" in your find command with a "\", however, your use of double-quotes *should* achieve the same end. All the same, why don't you try?
On 7/10/06, Stefan Knecht < knecht.stefan@xxxxxxxxx> wrote: > > I've been having some odd issues with find where the order of the > filters mattered. > > try to put -mtime before -name and see if that helps > > Stefan > > > > > On 7/8/06, Steve Perry <sperry@xxxxxxxxxxx> wrote: > > > > Didn't know if anyone else has run across this, but I spent 1.5 hours > > trying to get a tried and true find command to work on RHEL4 (32-bit) > > without success. > > > > I wanted to delete the audit files in $ORACLE_BASE/admin/<SID>/ > > adump that were older than 60 days. It shouldn't be rocket science > > or so I thought. > > > > the command was > > > > find $ORACLE_BASE/admin/<SID>/adump -name "ora*.aud" -mtime +60 > > > > It was supposed to have " -exec rm {} \;", but I never got that far > > because it wouldn't return any files. > > > > i could use -60 and it would return files less than 60 days, but "+" > > failed to return anything. I tried ctime as well, but nothing. > > man and google didn't return anything. > > > > Anybody run across this before? > > I thought I'd ask before writing a perl script. Does anyone have any > > one-line perl scripts before I write a longer one? > > > > Thanks, > > steve > > -- > > http://www.freelists.org/webpage/oracle-l > > > > > > >
-- Cheers, -- Mark Brinsmead Staff DBA, The Pythian Group http://www.pythian.com/blogs
- Re: OT: find command on rhel4 not working with mtime
- From: Mark Brinsmead
- OT: find command on rhel4 not working with mtime
- From: Steve Perry
- Re: OT: find command on rhel4 not working with mtime
- From: Stefan Knecht
- Re: OT: find command on rhel4 not working with mtime
- From: Mark Brinsmead