Heres an account of how I first ever saw the consequences of badly written
scripts and rm -r * .....
Installing ADSM by hand is a pain and can be accomplished far more easily with
a script to automate the process, ask a few questions and register the node,
setup default schedules etc etc etc..
Now, this particular organisation had written a script to do this, and it also
moved the ADSM installation from /usr/lpp/adsm/bin to something like
/osmf/blah/adsm
Now, part of the scripts job was to detect an old installation and remove it
from /osmf/etc/adsm.
It did this with the correct o/s comamnds, and then used the infamous rm -r *
to remove custom directories and scripts that were under the ADSM directory.
Thing is, before it ran the rm -r *, and being ultra safety concious (ha!), and
being aware that Ops not Sysadmins were running the script, it asked, threee
times in a row,
Did you run the script from the /osmf/etc/adsm directory y/n?
ARE YOU SURE y/n ?
OK to remove old ADSM directories y/n ?
Or words to that effect....
Now, If your rolling out 100 clients using a script the whole process becomes
habitual and boring...
you guessed it. The end result was people would run the script and not even
read the threee questions, they would simply hit y[enter]y[enter]y[enter] in
quick succession because they knew they were in the right place and this
annoying script kept on asking them to double check. That would have been fine
if the cd to the adsm dir had worked and not left them in /
The first thing I knew about the mess was when someone came over and said,
'Erm, can you have a look at this?'
So I go over and the last line I can see on the screen is;
root.blah>ls
ksh: ls: not found.
root.blah>
Funny. First thing I thought was oh, thats Ok, we can restore from ADSM.......
And as a final confession, It was me that had written the script. Being a
novice at the time I wasnt aware of basic commands like basename.
Never Ever Again :)
And, I know that at least two people who were there at the time read this list,
so Pete - Yes you can laugh, and Matthew L, Learn To Read and Dont Just Hit
Enter :-) (And I promise not to do that in a script again ever.)
Matthew Warren.
** IMPORTANT INFORMATION **
This message is intended only for the use of the person(s) ("the Intended
Recipient")
to whom it is addressed. It may contain information which is privileged and
confidential
within the meaning of applicable law. Accordingly any dissemination,
distribution, copying
or other use of this message or any of its contents by any person other than
the Intended
Recipient may constitute a breach of civil or criminal law and is strictly
prohibited.
If you are not the Intended Recipient please contact the sender and dispose of
this email
as soon as possible. If in doubt contact the Tibbett & Britten Group Network
Administration
Department on 01707 391010 (UK).
|