Xref: utzoo comp.unix.questions:6705 comp.unix.wizards:8037 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!oliveb!pyramid!voder!kontron!optilink!cramer From: cramer@optilink.UUCP (Clayton Cramer) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Recovery ofremoved files Message-ID: <2028@optilink.UUCP> Date: 25 Apr 88 23:01:35 GMT References: <367@axis.fr> <54@lakart.UUCP> Organization: Optilink Corporation, Petaluma, CA Lines: 33 > From article <367@axis.fr>, by inra@axis.fr (Inst. Natl. Rech. Agronomique): > > > > After rm command is it possible to recover removed files > > Believe it or not, but way back in the dim and distant past, a guru I > knew at university had an unrm program (from what I could gather, it knew > the nature of the freeblock list, and it looked at where the returned blocks > were put, and then wrote their contents to a different file structure. > Admittedly this was done under UNIX V6 from bell labs - whether the idea is > portable to BSD or System 5, I have no idea. > Here's my solution. (Not elegant, but worth considering). Put the following csh script in /usr/local/bin/del. ====================================================================== # /bin/csh foreach file ($argv) mv $file /tmp/$USER/$file:t end ====================================================================== and a line in your /usr/lib/crontab file to delete files more than three days old from /tmp/$USER. (You generally notice that a file you've deleted needs undeleting within about ten seconds of doing an rm). Why not call the script rm, so it's transparent to the user? Well, then you have to handle all the options on rm, because every program and shell script that uses rm will be trying to run your program, not /bin/rm. Of course, you could always handle the problem by making the above script an alias instead. Clayton E. Cramer