Recovering Files on the Central UNIX Servers

If you accidentally erase a file, you can usually recover it yourself using the recover command on the composers. Files are backed up every night. You can recover a file that has been on the server for up to 6 months.

Note: This process will only recover files from the Central UNIX servers.

Where to find the recover command

recover is located in the /usr/bin directory. By default, you should be able to find this command. However, if you see the following message:

 recover: Command not found

You may need to type /usr/bin/recover to run the program.

How to recover a file

Note: This process will only recover files from the Central UNIX servers.

  1. Log in to one of the UNIX servers.

    If you are unsure what this means, see Secure Shell Instructions for Windows computers or Using the Terminal Program on a Macintosh for help.

  2. Change into the directory where the file used to reside.

    For example, if you want to recover a file that used to reside in a folder you created and named data, at the UNIX prompt, type
     cd data
    

    and press ENTER. You are now in your data directory.

  3. Start the recover program.

    At the UNIX prompt, and while working in the directory in which the original file resided, type
    recover 

    and press ENTER. It might take up to a minute for the recover> prompt to appear. It should look similar to

    recoverstart

  4. Get a list of files available to recover.

    At the recover> prompt, type
     ls -a 

    and press ENTER. You will see a list of files. For example, if you are in the data directory then the files will have the same names as the folders in your directory.

  5. Get the versions of the file you want to recover.

    At the recover> prompt, type
     versions
    filename

    replacing filename with the name of the file you wish to recover then press ENTER. A list of versions of the file saved on different dates appears. You should see a display similar to this one when looking for the versions of the folder class in the data directory:

    recoverver

    In this example, the most recent version of "class" saved on February 21, 2002 is the largest version with a size of 1584. The size of the file is displayed on the same line as the name of the file, right before the date.

  6. If you see a program prompt that reads, Display more versions of /home/usra/0c/03174/mail/______, press the Y key.

  7. Select the correct version of the file you want to recover.

    Find the date just prior to the date on which your file disappeared. If the most recently backed-up version is the version you want to recover, proceed to step 7 (add).

    If, however, the most recently backed-up version is not the one you want to recover, use the changetime command to indicate which date you want. Note: Use the save time:, not the creation date, to determine which date and time to use with the changetime command. For the previous example, at the recover> prompt, type

     changetime feb
    21 02:02 2002 

    and press ENTER to enable the recover program to use the version saved on February 21 at 02:01:17. Note that this process may take a few minutes. Before you proceed to the next step, you must wait until the system displays the prompt, Time changed to....

    Also note that, for the changetime command, you need to type a time just past the save time:.

  8. Now add the file to create the list of files you want to recover.

    At the recover> prompt, type
     add
    filename

    replacing filename with the name of the file you want to recover and press ENTER. You can check to see that the correct files are selected by typing

    list 

    at the recover> prompt and pressing ENTER. You should see a display similar to the following:

    recoveradd

    If you have more files to recover from the same changetime, go back to step 7: otherwise, go back to step 6. Continue this process until all files have been added to the recover list.

    Other recover commands help you prepare to recover your file. For example, you can use relocate directoryname to recover a file into a different directory, or delete filename to remove a file from the recover list. To see a list of additional commands and a terse explanation of their function, at the recover> prompt, type:

    help

    and press ENTER. You should see a display similar to the following:

    recoverhelp

  9. Recover your files.

    At the recover> prompt, type:
     recover 

    and press ENTER. After typing this command, it might take a long time (5-40 minutes) for the program to find the files and reload them.

  10. Remember, if any file has the same name as a file you plan to recover, rename it so that the recovered file does not replace the current one.

    When prompted, type R to rename the file. This will create the file filename.R where filename is name of the file you are recovering.

    For example, if you are recovering a data folder named class, typing R to rename it will create class.R as the recovered file.

  11. Exit from the recover program.

    When the recover> prompt reappears, your files should have been recovered, and you can exit the command. Type:
     quit
    

    at the recover> prompt then press ENTER. The next sample screen displays the commands to recover the most recent versions of the files class and read-mail that are mail folders in mail directory.

    recovermail