Difference between revisions of "Recover"

From NetHackWiki
Jump to navigation Jump to search
m (Accidental new shell)
(Improved hatnote formatting, and removed SLASH'EM section as the information is already present elsewhere)
Line 1: Line 1:
<small>''"Crash" redirects here. For the sound effect, see [[one word messages#Sound effects|Crash!]]''</small><br />
+
:''"Crash" redirects here. For the sound effect, see [[One word messages#Sound effects|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.
+
 
 +
'''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:
 
When trying to restart the game, you get the error message:
Line 8: Line 9:
 
Say no to the above and keep reading.
 
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 ask for [[freenode|help]].
+
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 [[freenode]].
  
 
==General use==
 
==General use==
Line 20: Line 21:
 
This will most likely only rebuild the savefile, but you might need further commands, depending on your system, to actually reuse it.
 
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 [[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|vulture's eye]], the name is hard-coded to ''alock''. The command is something like this:
+
For [[Vulture|vulture's eye]], the name is hard-coded to ''alock''. The command is something like this:
  
 
  vultureseye-recover -d <playground> alock
 
  vultureseye-recover -d <playground> alock
Line 90: Line 91:
  
 
*Finally. Hopefully, you can play now. Ask for [[freenode|help]] if this is too much for you.
 
*Finally. Hopefully, you can play now. Ask for [[freenode|help]] if this is too much for you.
 
{{todo|if slashem is the same then there doesn't seem to be much point in noting it}}
 
 
===[[SLASH'EM]]===
 
 
For SLASH'EM, it's almost the same as for nethack. Simply replace "nethack" with "slashem". So the example becomes:
 
 
sudo /usr/lib/games/slashem/recover -d /var/games/slashem 1000bob
 
  
 
==External links==
 
==External links==

Revision as of 03:49, 8 December 2019

"Crash" redirects here. For the sound effect, see One word messages § 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 freenode.

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 it 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 it in 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/

  • Finally. Hopefully, you can play now. Ask for help if this is too much for you.

External links

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.