Re: OT - Getting fired for database oops
- From: Guillermo Alan Bort <cicciuxdba@xxxxxxxxx>
- To: tony_vanlingen@xxxxxxxxxxxxxxxxxxxxx
- Date: Mon, 18 May 2009 21:58:34 -0300
I usually run find ... rm -f {} \; I am used to it... it's just a matter of
running a pwd and ls -lR to make sure you are only deleting what you want.
Plus a -name or -mtime o -atime flag to rm. I don't run rm without find, and
I always run the find with ls before I run it with RM. This reduces the
chance of error to nearly zero.
Of course, I make sure the files are backed up (logs usually) when I delete
something.
hth
Alan Bort
Oracle Certified Professional
On Mon, May 18, 2009 at 8:47 PM, Tony van Lingen <
tony_vanlingen@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Of course, using GNU rm the -f option overrides the -i... On a Ubuntu
> system:
>
> [lingent@T1W101955][19/05/2009 09:38:18][~/test]
> $ alias rm
> alias rm='/bin/rm -i'
> [lingent@T1W101955][19/05/2009 09:38:23][~/test]
> $ rm tralal
> /bin/rm: remove regular empty file `tralal'? n
> [lingent@T1W101955][19/05/2009 09:38:29][~/test]
> $ rm -f tralal
> [lingent@T1W101955][19/05/2009 09:38:33][~/test]
> $
>
> There's no one-size-fits-all solution in a *NIX environment.. ;)
>
> Cheers,
> Tony
>
> Jared Still wrote:
>
>> Yup, you're right on that, I just tested it.
>>
>> The -i file trick will prevent command line snafu's
>> such as 'rm -rf'.
>>
>> In the case of '-r' it causes rm to ask:
>> rm: descend into directory `a'?
>>
>> When used with find | xargs rm however, the '-i' is not passed.
>>
>> I tried with '-exec rm {]\;' but that no longer seems to work.
>>
>> Dunno if the syntax has changed, or what.
>>
>> jkstill-2 > find . -exec 'rm -rf' {}\;
>> find: missing argument to `-exec'
>> [ /home/jkstill/tmp/rm_test ]
>>
>> jkstill-2 > find . -exec 'rm ' {}\;
>> find: missing argument to `-exec'
>>
>>
>> Jared Still
>> Certifiable Oracle DBA and Part Time Perl Evangelist
>>
>> --
> //www.freelists.org/webpage/oracle-l
>
>
>
Other related posts:
- » OT - Getting fired for database oops- Newman, Christopher
- » Re: OT - Getting fired for database oops- Mayen . Shah
- » Re: OT - Getting fired for database oops- Howard Latham
- » Re: OT - Getting fired for database oops- Maureen English
- » RE: OT - Getting fired for database oops- Freeman, Donald
- » RE: OT - Getting fired for database oops- Goulet, Richard
- » Re: OT - Getting fired for database oops- Howard Latham
- » Re: OT - Getting fired for database oops- Jared Still
- » Re: OT - Getting fired for database oops- Mike Haddon
- » Re: OT - Getting fired for database oops- Guillermo Alan Bort
- » Re: OT - Getting fired for database oops- Nuno Souto
- » Re: OT - Getting fired for database oops- LS Cheng
- » RE: OT - Getting fired for database oops- Bobak, Mark
- » Re: OT - Getting fired for database oops- Riyaj Shamsudeen
- » RE: OT - Getting fired for database oops- John Hallas
- » RE: OT - Getting fired for database oops- alever\@libero\.it
- » RE: OT - Getting fired for database oops- Goulet, Richard
- » Re: OT - Getting fired for database oops- Stephen Booth
- » RE: OT - Getting fired for database oops- alever\@libero\.it
- » RE: OT - Getting fired for database oops- Taylor, Chris David
- » RE: OT - Getting fired for database oops- Goulet, Richard
- » Re: OT - Getting fired for database oops- Joey D'Antoni
- » RE: OT - Getting fired for database oops- Bobak, Mark
- » Re: OT - Getting fired for database oops- Charles Schultz
- » RE: OT - Getting fired for database oops- Goulet, Richard
- » Re: OT - Getting fired for database oops- Stephen Booth
- » Re: OT - Getting fired for database oops- Howard Latham
- » RE: OT - Getting fired for database oops- Johnson, George
- » Re: OT - Getting fired for database oops- Mathias Magnusson
- » RE: OT - Getting fired for database oops- Goulet, Richard
- » RE: OT - Getting fired for database oops- Rich Jesse
- » Re: OT - Getting fired for database oops- Jared Still
- » RE: OT - Getting fired for database oops- Matthew Zito
- » Re: OT - Getting fired for database oops- Jared Still
- » RE: OT - Getting fired for database oops- Bobak, Mark
- » Re: OT - Getting fired for database oops- Andrew Kerber
- » Re: OT - Getting fired for database oops- Robert Freeman
- » Re: OT - Getting fired for database oops- Jared Still
- » Re: OT - Getting fired for database oops- Tony van Lingen
- » Re: OT - Getting fired for database oops - Guillermo Alan Bort