# Recover
"Crash" redirects here. For the sound effect, see One word messages&nbsp;§ Sound effects.
recover is the small utility program that comes with NetHack. It is used to turn temporary level files into a save file, for example after a power outage during a game.
When trying to restart the game, you get the error message:
"There is already a game in progress under your name. Destroy old game? [yn]"
Say no to the above and keep reading.
Unfortunately, the utility is not totally automated. You need to know some basics about the command line. If you have difficulties, you can ask for help on Libera.

Contents

1 General use
2 Specifics for Linux/Unix

2.1 Accidental Ctrl-Z
2.2 Accidental new shell
2.3 Running the command
2.4 Using the file again

3 External links

General use
Depending on your system, you use a command similar to this:

<fullpath>recover -d <playground> <username>
<fullpath>recover Actually, the utility is not a normally accessible command, you need to use the full path to the executable.
<playground> is the Playground path where the temporary level files were put during gameplay.
This will most likely only rebuild the savefile, but you might need further commands, depending on your system, to actually reuse it.
For SLASH'EM and probably other variants, it's almost the same as for nethack. Simply replace "nethack" with "slashem" (or other variant name).
For vulture's eye, the name is hard-coded to alock. The command is something like this:

vultureseye-recover -d <playground> alock

Specifics for Linux/Unix
Accidental Ctrl-Z
First make sure you didn't just press ctrl-Z by accident. This simply suspends the current game with out any real damage. A characteristic "[1]+  Stopped nethack" message is given. Read the "fg" article first.

Accidental new shell

A user has suggested improving this page or section as follows:
"What are these keyboard shortcuts for some popular environments??"

Another possible accidental keyboard shortcut. Depending on the command line environment, terminal simulator or desktop environment, they are various keyboard shortcuts to launch a new shell on top of the one you are currently using. This is inside the same window you are using and no message is given. Apparently you drop back in the command line, with no message.
First make sure you aren't in the "Ctrl-Z" situation. The command "jobs" should return nothing. "Ctrl-Z" is a more frequent error and has a characteristic message. When you excluded "Ctrl-Z", to go back to the game, just give the "exit" command (caution!!!! Read the rest first). This command simply kills the current terminal, in our case the superfluous terminal, so make sure you really are in this situation before you try it. If you give the "exit" command after a "Ctrl-Z", you'll probably have to use the recover utility.

Running the command
On Linux and other Unixen, you usually invoke recover like this:

sudo <fullpath>recover -d <playground> <uidusername>

For ubuntu systems, that would be something like this:

sudo /usr/lib/games/nethack/recover -d /var/games/nethack 1000Bob

This will create a file "1000Bob" in "<playground>" directory. If successful it will give the message "recovered "1000Bob" to 1000Bob".

<fullpath>recover Actually, the utility is not a normally accessible command, you need to use the full path to the executable. In Ubuntu systems, the full path is "/usr/lib/games/nethack/".
<playground> is the Playground path where the temporary level files were put during gameplay. In Ubuntu systems, that would be "/var/games/nethack/save"
<uidusername> is the file name of the temporary files, without extension. You can easily guess it by inspecting the Playground. They are two components, the "UID" and the "username". It's the UID and username of the user on the system. The UID is a number unique for a user. On single user systems, the UID is usually "1000". The "username" is just the user name or log in .
If you are using official NetHack and your distribution does not come with recover you can download it from the official download-page at http://www.nethack.org/. Check first the other installed files.

Using the file again
Once you executed the recover command successfully, you need to give the created file the correct group.
In general, run the command:

sudo chgrp games <playground><uidusername>

In the example:

sudo chgrp games /var/games/nethack/1000bob

Then, you compress the file with:

sudo gzip <playground><uidusername>

In the example:

sudo gzip /var/games/nethack/1000bob

This will create a file with the extension ".gz" or "<uidusername>.gz". In the example "1000bob.gz".
Then copy the file to the save directory:

sudo cp -p <playground><uidusername>.gz <playground>/save/

In the example:

sudo cp -p /var/games/nethack/1000bob.gz /var/games/nethack/save/

With luck, you can play now. Ask for help if not.

External links
recover manual

This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.

</playground></uidusername></playground></uidusername></uidusername></playground></uidusername></playground></uidusername></playground></fullpath></playground></uidusername></playground></fullpath></playground></playground></fullpath></username></playground></fullpath>