IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Unix at its worst
Somebody was complaining in e-mail today that a bunch of important files got deleted by incorrect "rm -r" Here is one of the answers he got:

>>>>>>>>>>>>>>>>>

A handy tip for directories you MUST keep. Create a file at the top level
called '-i'. Now if you do a rm *, you'll implicitly get rm -i, which will
force you to confirm deletions.

I've created one in the top level /build. It'd be worth putting one in
your top level master directories.

It's not bullet proof, but it helps

<<<<<<<<<<<<<<<<<<<
New Oh, good idea!
----

My pid is Inigo Montoya. You "killed -9" my parent process. Prepare to vi.
New That freakin' rocks!
So simple, yet so obscure. We love it here at work!
-YendorMike

In order to understand recursion, one must understand recursion.
New Why not simply create a background process
that every hour or so creates a (hard, not symbolic) link to the files in those important directories? (Say to a /saved directory). rm is only going to remove the file if all of the inodes are gone, and since an inode for the file exist (to /saved) the file won't be deleted.


Kewl thing is, all it costs in space is an extra directory entry. If you really want to have fun, this background process is owned by someone else and users won't be able to delete files through it. (They can overwrite files with an empty file, howeverm and the background process will pick it up.)

Expand Edited by Simon_Jester Aug. 2, 2001, 12:27:32 AM EDT
New Good Admin = Lack of Hacks
Do things the right way - pay attention, be careful, and keep backups.
New A crutch
You can do this. It works. It's a good thing to know about (also a useful thing to keep in mind when ls or rm commands fail to performa as expected). But it's a crutch.

Better: use, and learn the use of, an effective version control system, and backups.

The problem with crutches are that you come to depend on them. At some point, you'll find yourself in one of two situations: there is no crutch (you're elsewhere, without it), or it's been kicked out from under you (someone's removed the '-i' file), and you'll make a mistake. Better learn to live without it.
--

Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]


What part of "gestalt" don't you understand?
New 100% Correct
Moreover, it will hork exec clauses in find commands. It's a terrible idea.
New - - (dash dash)
DeSitter notes that oddly named files can interfere with other directory-access commands (eg: find). I made a similar observation regarding 'ls' and 'rm' commands being borked by dash files.

This can usually be circumvented by trailing a command with a '--' (that'a double-dash), particularly when giving a wildcard or otherwise expanded filelist as arguments. In many shell tools, a double-dash without arguments indicates end of arguments. Exceptions prove the rule, naturally. In startx, a double-dash seperates client and server options.
--

Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]


What part of "gestalt" don't you understand?
New Sounds unnecessarily complicated.
Why wouldn't a simple alias of "rm" to "rm -i" in the system login script be better?
--
Peter
Shill For Hire
New Better, But Also Bad
Aliases belong in individual profiles. I'm very much against system-wide aliases.
New Agree
But while we're holding the user's hand...
--
Peter
Shill For Hire
New Just thinkin...
...that you can't say that ("Aliases belong in individual profiles") in an unqualified manner. It's not always true.

Systems Administration is all about the devising and applying of policy, which is presumably intended to provide levels of availability and service according to business needs.

Such a policy might be along the lines of "to avoid costly file restoration procedures, the system shall be required to use rm -i for all interactive file deletions".

Sure, it's not "pure". But if aliasing "rm" to "rm -i" in the system login script on a development box saves me from having to

1. consult the backup paperwork to determine which tape the files are on
2. go to the fire safe
3. get the tapes
4. catalogue the tapes
5. restore the files
6. Put the tapes back in the fire safe
7. Goto 1, the user never tells you which files they really want first time around

then I'm all for it.
--
Peter
Shill For Hire
New Triumph of the practical over the Pure?
Remember renaming format? to _ormat, in situations where the rash outnumbered the marginally clueful, not to mention fdisk (did the very first versions sport, "Are You Sure?")

Ever thus.

[arrogant coders rant]
Gotta love rm -r. Noticed on a site, the reply to an unabashed newbie who had asked a question without er.. 'proper respect'? (or maybe disdain for RTFM) or maybe someone's Evul Twin was loose.. Misplaced the link - funny in a wings-off-butterflies sense of 'fun'.

It was evident even to me that - his hd1 was never going to be the same. I mean, certain letter-combinations are instantly ALERTing. The rest of long thread had to do with various..

"He DID it?" Yup.. "Oh God - WHY did you tell him That?"
"I didn't think he'd Really do it.." You asshole. "I didn't think he'd really DO it..."

"Well can he recover with ___ ?" Nope.. "Was it hd0? "Nope"

Anyway.. when ya keep the scalpels in the *same drawer* with the pick-up-sticks game pieces - you WILL get cut. I guess that *nix is postulated upon the idea that "Are You Sure" is for wimps. How sweet.

Arrogance. Some days we are ALL wimps. Is an extra [Y] really too much to waste (287 mSec average) VS massive destruction / drudgery next?

[/rant]



Have a Nice Daze, Oh Perfect Practitioners & Typists
New That extra [Y] - unacceptable.
No, that wouldn't work. The reason Unix commands ask no questions is they are used by automation scripts most of the time and the questions would either be confusing or there would be no one there to answer them.
[link|http://www.aaxnet.com|AAx]
New Re: That extra [Y] - unacceptable.
How many times do you blindly answer 'OK' or 'Y' or... how often has it saved you? right, it's just an annoyance. It works the first few times you encounter it and thereafter it just gets in the way. If you're gonna mess up, that extra prompt is likely to save you only if you've never seen it before and maybe not even then. The only way to protect against something like 'rm -r' is to simply not have that feature. But it would be too painful to live without. That's why we have backups...
Have fun,
Carl Forde
New OK disable w/scripts natch. But: 'self-destruct CR'?____:[
New Not really.
The reason UNIX commands ask no questions *by default* is that when UNIX was designed, the people using the OS were, well, the people who wrote it.

The user base was never envisioned as expanding beyond the highly technically capable scientific and computing academics who first used it.

Compare and contrast UNIX and VMS, which was commercial from the outset, intended for use by real human beans.

One example will suffice. To get help on a command, you type "man foo" on UNIX. On VMS, you type "HELP FOO".
--
Peter
Shill For Hire
New Personally.. prefer: wombat foo. Nice ring to it -
New Re: Personally..., I prefer: foo man choo. :)
Alex

Only two things are certain: the universe and human stupidity;
and I'm not certain about the universe.
-- Albert Einstein (1879-1955)
New LRPD settles All!
Three rings for the elven-kings under the sky
Seven for the Dwarf-lords in their halls of stone.
Nine for Mortal Men doomed to die
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.

One Ring to rule them all
One Ring to find them
One Ring to bring them all
and
in
the
darkness
bind
them



And still reigneth The Ring !!


Only now it taketh the form of the omnipresent, greatly sought after.. hallowed sound of












The Cash Register...




When everyone has bar-code price tags on foreheads.. only Outlaws shall have no price on their head.
New Hey! That's my other alternate personality!
fumanchu@amor.org

It's my radio handle :)
That's her, officer! That's the woman that programmed me for evil!
New much better way
cd /
mkdir *
then wait ]:^>
thanks,
bill
Our bureaucracy and our laws have turned the world into a clean, safe work camp. We are raising a nation of slaves.
Chuck Palahniuk
     Unix at its worst - (Arkadiy) - (21)
         Oh, good idea! -NT - (jlalexander)
         That freakin' rocks! - (Yendor)
         Why not simply create a background process - (Simon_Jester) - (1)
             Good Admin = Lack of Hacks - (deSitter)
         A crutch - (kmself) - (2)
             100% Correct - (deSitter) - (1)
                 - - (dash dash) - (kmself)
         Sounds unnecessarily complicated. - (pwhysall) - (12)
             Better, But Also Bad - (deSitter) - (11)
                 Agree - (pwhysall)
                 Just thinkin... - (pwhysall) - (9)
                     Triumph of the practical over the Pure? - (Ashton) - (8)
                         That extra [Y] - unacceptable. - (Andrew Grygus) - (7)
                             Re: That extra [Y] - unacceptable. - (cforde) - (1)
                                 OK disable w/scripts natch. But: 'self-destruct CR'?____:[ -NT - (Ashton)
                             Not really. - (pwhysall) - (4)
                                 Personally.. prefer: wombat foo. Nice ring to it - -NT - (Ashton) - (3)
                                     Re: Personally..., I prefer: foo man choo. :) -NT - (a6l6e6x) - (2)
                                         LRPD settles All! - (Ashton)
                                         Hey! That's my other alternate personality! - (tseliot)
         much better way - (boxley)

Powered (for now) by thermodynamics!
147 ms