Restoring deleted files
There is no 'undelete' command in UNIX. Instead, a deleted file must be retrieved from backups. There are three types of backups maintained at CSE: "incremental backups", "full backups", and "snapshots".The tools described here are searching through massive file indices and and are quite slow to startup. Give them several minutes before assuming something is wrong.
Using the Graphical Program: tkrestore
The easiest way to restore from incremental or full backups is to use the command /usr/local/bin/tkrestore. If you are not running X (for instance, you are connected on a text-only ssh session) you should use the various text based command line tools described in the next section.What follows is a brief description of tkrestore, and its operation. For more details of tkrestore, click on the help button while using tkrestore.
- Within tkrestore, files and directories available for restoration are listed on the left.
- Files that are available from incremental backup sources are flagged with an i, while those coming from full backup sources are flagged with an f.
- The user selects files to restore in the left side. Using the Add button adds them to the list of files to restore listed on the right.
- Clicking on the Restore button will eventually restore all those files currently listed in the Restore window, into a directory under your home directory called: ~/Restored_Backup/ source-date, where source is either i or f depending on the backup source, and date is the date on which the backup was taken.
Incremental Restorations
Incremental backup restorations are performed immediately, or at least as soon as the user clicks on the restore button (tkrestore calls the program /usr/local/bin/restorebu to do this).Currently, you need to explicitly select every file you wish to restore from incremental backups, as restorebu will not allow you to restore directories (and by implication, their contents and sub-directories) from incremental backups.
Full Backup Restorations
Unlike Incremental restorations, full backup restorations cannot always be done immediately, and need to be recorded with the backup system first before they are performed. This is because:- The restoration tape drive may be unavailable when the user requests a restoration;
- The desired tape media source may not currently be loaded in the tape library, and may require operator intervention before the tape is made available, and the files can be restored;
Full backup restorations are performed in batches every 15 minutes by the server on which the tape library is installed. As long as the appropriate tape drive, library, and media are available, each recorded full backup request is serviced, and email is sent to the user making the request once the files and directories are finally restored. If a tape required for restoration is not loaded in the tape library, email is sent to the system operator requesting that the tape in question be loaded into the library.
Restoring files from a group account
tkrestore can also be used to restore any files that are in your project group account, providing that you are a current member of the group, and the home directory of that group account has user ID execution sticky bit turned on. You can run a quick test:listbu -u groupname
...to see if that has been set. If it returns:
ERROR: listbu: the S_ISUID bit is not set on this user account.
Contact the owner or ss to enable group restores
...then send an email to ss. Otherwise, if it returns a list of files available for restoring, then you can run tkrestore to restore them. (When you run tkrestore, select groupname from the list box under "List files for:")
Text Based restoration tools
tkrestore uses Tk/TCL, and as such, can only be used over a graphical connection (usually X based) with a CSE machine. Text based restoration tools exist that can be used over non-graphical connections, but currently these tools only enable restorations to be made from incremental backups, and not from full backups. The following tools may be used:- /usr/local/bin/restore.simple. This shell script provides a simple text based interface to two of the basic incremental backup commands: /usr/local/bin/listbu, and /usr/local/bin/restorebu. It allows the user to specify, expand, and restore selected versions of file backups, which it restores into current directory with the suffix ".RESTORED". Note that this differs from tkrestore which restores files into the directory ~/Restored_Backup/~/.
- You can also directly use the basic incremental backup commands: /usr/local/bin/listbu, and /usr/local/bin/restorebu.
For example, the following will restore the most recent version of the file mail/INBOX into your current working directory:
listbu -r mail/INBOX | restorebu -lSee the manpages for listbu and restorebu for more details.