Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jan 2003 03:14:40 +0100
From:      Brad Knowles <brad.knowles@skynet.be>
To:        JacobRhoden <jrhoden@unimelb.edu.au>
Cc:        freebsd-chat@FreeBSD.ORG
Subject:   Re: recover overwritten file
Message-ID:  <a05200f54ba5650ecb7ed@[10.0.1.2]>
In-Reply-To: <200301241134.31376.jrhoden@unimelb.edu.au>
References:  <200301232258.h0NMwlaX006708@grimreaper.grondar.org> <200301241004.46881.jrhoden@unimelb.edu.au> <200301241134.31376.jrhoden@unimelb.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
At 11:34 AM +1100 2003/01/24, JacobRhoden wrote:

>  Heres a thought, a modification to the 'rm' command, whereby if a certian
>  environment variable was set (ie TRASH_DIRECTORY or something) then rm would
>  do a move instead of a unlink. A flag could be added to rm to force delete
>  (when the environment variable is being used)... what woudl be the chances of
>  something like that getting committed?

	The problem comes in the details.  I wrote a shell script like 
this many, many years ago (1986?).  However, what do you do when you 
get two files with the same name?  And how do you properly un-rm them 
-- how do you know where to restore the file to?  One idea would be 
to check things into CVS, but then what do you do about binaries? 
How do you deal with massive recursive removals?

	Myself, I found that the biggest problem was that this doesn't 
solve the whole problem -- sure, I could cover rm, but that didn't 
help me when I mv'ed one file onto another, and I lost two weeks 
worth of work on a class project.  When I protected both mv and rm, 
that didn't help me when I accidentally redirected the output of a 
program onto a file I had wanted to keep.


	Basically, I got used to having these around these crutches, and 
then I really seriously hurt myself when they suddenly didn't provide 
coverage for the specific type of foot-shooting that I was engaging 
in.

-- 
Brad Knowles, <brad.knowles@skynet.be>

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
     -Benjamin Franklin, Historical Review of Pennsylvania.

GCS/IT d+(-) s:+(++)>: a C++(+++)$ UMBSHI++++$ P+>++ L+ !E-(---) W+++(--) N+
!w--- O- M++ V PS++(+++) PE- Y+(++) PGP>+++ t+(+++) 5++(+++) X++(+++) R+(+++)
tv+(+++) b+(++++) DI+(++++) D+(++) G+(++++) e++>++++ h--- r---(+++)* z(+++)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a05200f54ba5650ecb7ed>