[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help! Accidentally started deleting /usr



on Sat, Apr 07, 2001 at 11:56:26AM -0600, Joe 'Zonker' Brockmeier (jbrockmeier@earthlink.net) wrote:
> Hey all,
> 
> > By the way, is there any way of setting up an "undelete" for averting this
> > kind of disaster?  My Dad mentioned that Novell Netware has an undelete
> > which basically puts off really deleting stuff for about 5 days --- unless
> > it has to because of lack of space.  This sounds like a _very_ useful
> > feature.
> 
> Good lord, please NO. Having an "undelete," IMHO, leads to very
> sloppy practices - better to learn to make backups of important
> data - and to use the root account with care. 

I tend to agree.  Backups are an essential element for system data
security.  Reliance on undelete leads to sloppy habits.

> There were some good suggestions, though - make an alias from
> rm to 'rm -i' so that you always get prompted against making 
> massive mistakes. 

I prefer not doing this.  Treat 'rm' as if it's the red hot poker it is.
In particular, aliasing rm to interactive mode gets you in the habit of
relying on a crutch which may not be be present.

I prefer *not* to invoke rm as root whenever possible, particularly when
dealing with whole directory trees.  

There was a thread on this topic as well recently -- how to automate
practices with find.  When deleting large swathes of files, my MO is
typically:

  - Create a script listing the files to be deleted, explicitly.  Scan
    this several times before committing it.

  - When deleting a tree of directories, chown it to a standard user,
    then delete as that user.  You get a two-stage commit, and the
    dangerous action (rm) is performed as an unprivileged user.

> I've accidentally deleted a few projects in my own home directory -
> but I make backups at least once a week and burn them to CD. Even in
> the event of a catastrophic failure of my hard drive, I only need to
> buy a new drive and copy my home directory over.

A stitch in time saves nine.

-- 
Karsten M. Self <kmself@ix.netcom.com>    http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?       There is no K5 cabal
  http://gestalt-system.sourceforge.net/         http://www.kuro5hin.org

Attachment: pgpLHcuB5AtWE.pgp
Description: PGP signature


Reply to: