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

Re: Worst Admin Mistake? was --> Re: /usr broken, will the machine reboot ?



Am Mittwoch, 14. September 2011 schrieb Andrew Reid:
> > On Wed, Sep 7, 2011 at 1:00 PM, Bob Proulx <bob@proulx.com> wrote:
> > > jacques wrote:
> > >> by error most of the binaries in /usr are erased (killing rm :-(
> > > 
> > > Everyone has made that mistake at some point.  I know I have!
> > 
> > Not me!  Though I did chmod -R /usr once.  I noticed it immediately
> > and cancelled.  Most of the commands were broken, though luckily tar
> > and scp still worked, so I copied over a backup and untarred it. 
> > This anecdote is brought up whenever anyone suggests skipping /usr
> > /bin in backups is a good idea because the data doesn't change and
> > would be recovered by OS reinstall anyway (yes I've heard that
> > argument).
> > 
> > Which brings me to another fun question.  What's your worst
> > administration mistake and how did you recover?
> 
>   I once tried to change the ownership of all the files in a user
> directory by doing something like "chown -R <newuser> .*" from within
> the directory -- I've forgotten what exactly I typed, but my motive was
> to get all the "." files included in the scope of the command.
> 
>   Unfortunately, ".*" includes "..", so the chown command hopped
> up to /home, and started switching the whole file system over
> to be owned by the new user.
> 
>   I caught it after it was taking a suspiciously long time, and
> after a minute or two, I figured out what had happened.

In my Linux/UNIX basics training I have a slide about exactly that.

And another one about escaping. Consider rm * and rm "*". Or mkdir "A 
directory with space" versus mkdir A directory with spaces.

And a recommendation to put echo in front of the command if unsure what 
the shell does make out of the command line.

Cause I think I do not need to let my course participants run into data 
loss experiences.

And yes, I did rm -rf .* once ;).

-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7


Reply to: