[comp.unix.wizards] CMS woes

marki@hpiacla.HP.COM (Mark Ikemoto) (11/26/87)

When I started learning HP-UX a few months back, someone handed
me a set of aliases that allow for removing and recovering files.

You create a directory called  .rmfiles  in your HOME directory and
use the following aliases in your .login or .cshrc file:

     alias rm     'mv !^ $HOME/.rmfiles/'
     alias unrm   'mv $HOME/.rmfiles/!^ .'

Thus, when you "remove" files, you are actually moving them to
a junk collector directory.

When you want to "unremove" a file, you use the unrm command.

In your .logout file which is executed upon logout from the
C-Shell, you add

     cd $HOME/.rmfiles
     /bin/rm -f .

to truly remove those files from the system before logging out.

You can also have cron clean out this junk directory for you on a
timed basis.  You could also modify your /etc/backup script to notify
your session, via some flag file in your HOME directory, that those
junk files have been archived before your .logout actually deletes them.
There are other possibilities.  I think I've even seen a contributed rm
lying around somewhere on one of our HP systems that does the same 
as the above aliases but in C code and with a little more sophistication. 


Mark

************************************************************************
* Mark Ikemoto 	       | {ucbvax,hplabs}!hpda!hpiacla!marki     [UUCP] *
* Hewlett-Packard Co.  | mark@hpiacla                           [SMTP] *
* 1266 Kifer Road      | (408) 746-5453                         [AT&T] *
* Sunnyvale, CA  94086 | 1-746-5453                        [HP-TELNET] *
*                      | "What If..."                   [HP-TELEPATHY] *
************************************************************************