home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!ugle.unit.no!news.uit.no!mack.uit.no!edvard
- From: edvard@mack.uit.no (Oyvind Edvardsen)
- Newsgroups: comp.unix.questions
- Subject: Re: Undelete
- Message-ID: <1993Jan7.125307.17829@news.uit.no>
- Date: 7 Jan 93 12:53:07 GMT
- Sender: news@news.uit.no (USENET News System)
- Organization: University of Tromsoe
- Lines: 23
-
-
- One way of implementing sort of undelete under UNIX is to redefine the rm
- command. This has been covered by the FAQ. Here is a slightly different
- method, also for csh(1). Insert the following into e.g. .login:
- alias rm 'mv -f \!* $TRASH'
-
- You need also to define the TRASH variable as a directory to put the
- 'removed' files in.
-
- In your .logout you can specify something like:
- find $TRASH \( -mtime +2 -o -size +10000 \( -type f \) \) -exec /bin/rm -f {} \
-
- One problem with this approach is that lots of people use workstations, thus
- logging out is not very frequent, and the TRASH directory may be pretty full
- after a while. Manual trash removal may be one solution, an other may be to
- use cron to run a find as above.
-
- Use /bin/rm instead of rm to by-pass the 'undelete' system. If you need to
- get back deleted (with redefined rm) files, get them from the TRASH
- directory.
-
- -oed.
-
-