Re: OT - Getting fired for database oops

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
>>
>>  --
> http://www.freelists.org/webpage/oracle-l
>
>
>

Other related posts: