These utilities are provided under the GNU license. They are free to use. Please pass any changes, modifications or suggestions to the author Phil Braham: realtime@mpx.com.au ================================================================================ Delete replces the Linux 'rm' command and, by default, moves the deleted files or directories to the $RUBBISH directory. Alternatively, using the -b flag, files or directories may be backed up the $BACKUP directory. Description: delete - as described above purge - purges the $RUBBISH or $BACKUP directories of old versions rest - restores file versions from the $RUBBISH or $BACKUP directory. For help us the -h flag on each command. To install: 1. Copy the following files to /usr/bin or /usr/local/bin directory (you will need root access to do this): delete purge rest 2. Create the following directories: ~/.rubbish ~/.backup Note: This is simply a suggestion. The directories may be placed anywhere. 3. Add the following cammands to the login (.bashrc for users): export $RUBBISH=~/.rubbish export $BACKUP=~/.backup alias rm='/usr/bin/delete' alias bu='/usr/bin/delete -b' alias purge='/usr/bin/purge' Note: Obviously if the rubbish and backup directories were placed elsewhere then the $RUBBISH and $BACKUP vars should point to there. The difference between delete and delete -b is that with the -b option the file is copied, not moved and it is placed in the $BACKUP directory rather than the $RUBBISH directory. Files are stored in both directories using version numbers which the filename suffixed by a ; and a number. For example, if the following is entered: bu bfile.c (assuming bu is an alias for delete -b), then the file is copied to the $BACKUP directory. If later the command is executed again, to backup a leter version of the file after changes have been made, then the files in $BACKUP are: bfile.c <<< latest version bfile.c;1 <<< Previous version If the command is executed again then the files in $BACKUP are as follows: bfile.c <<< latest version bfile.c;1 <<< First backup bfile.c;2 <<< Last backup Etc. Files in $RUBBISH are stored in the same way except, of course, previous versions are deleted from the source directory. Directories are dealt with in exactly the same way as individual files and all files within a directory are moved or copied as well. The purge command removes previous versions or all files from the $RUBBISH or $BACKUP directories. The rest command restores a given version of a file from either directory. Notes: To produce automatic backups before editing with vi use the following: Create file nvi: if test $# -gt 0 then delete -b $1 fi /usr/bin/vi $1 This will automatically create a backed up version of the file before editing. The rubbish and backup directories can be placed anywhere: they may be in a central location, rather than in a user directory, or different directories may be set up for a project simply by pointing $RUBBISH and $BACKUP to the correct directories. Also supplied is newvi - a script to backup a file before calling vi. This can be modified to call your own editor/