Difference between revisions of "Recover"

From NetHackWiki
Jump to navigation Jump to search
(In general)
m (Running the command: capital F)
 
(14 intermediate revisions by 10 users not shown)
Line 1: Line 1:
'''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.
+
:''"Crash" redirects here. For the sound effect, see [[One word messages#Sound effects|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:
 
When trying to restart the game, you get the error message:
Line 7: 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 [[Libera]].
  
 
==General use==
 
==General use==
Line 19: 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).
  
===[[Vulture's]]===
+
For [[Vulture|vulture's eye]], the name is hard-coded to ''alock''. The command is something like this:
  
For 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
+
==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.
  
==Linux/Unix==
+
===Accidental new shell===
 +
{{todo|What are these keyboard shortcuts for some popular environments??}}
  
===Ctrl-Z===
+
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 didn't just press ctrl-Z by accident. This simply suspends the current game with out any real damage. Read the "[[fg]]" article first.
+
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===
 
===Running the command===
Line 38: Line 45:
 
  sudo <fullPath>recover -d <playground> <UIDusername>
 
  sudo <fullPath>recover -d <playground> <UIDusername>
  
for ubuntu systems, that would be something like this:
+
For ubuntu systems, that would be something like this:
 
  sudo /usr/lib/games/nethack/recover -d /var/games/nethack 1000Bob
 
  sudo /usr/lib/games/nethack/recover -d /var/games/nethack 1000Bob
  
Line 53: Line 60:
 
===Using the file again===
 
===Using the file again===
  
Once you executed the recover command successfully.
+
Once you executed the recover command successfully, you need to give the created file the correct group.
 
 
*You need to give the created file the correct group.
 
 
 
in general, from with in the "<playground>" directory("cd <playground>"), run the command:
 
 
 
'''sudo chgrp games <UIDusername>'''
 
 
 
in the example:
 
  
sudo chgrp games 1000bob
+
In general, run the command:
  
*then, you compress it with:
+
sudo chgrp games <playground><UIDusername>
  
'''sudo gzip <UIDusername>'''
+
In the example:
  
in the example:
+
sudo chgrp games /var/games/nethack/1000bob
  
sudo gzip 1000bob
+
Then, you compress the file with:
  
this will create a file with the extension ".gz" or "<UIDusername>.gz". In the example "1000bob.gz".
+
sudo gzip <playground><UIDusername>
  
*then copy it in the save directory:
+
In the example:
  
'''sudo cp -p <UIDusername>.gz <playground>/save/'''
+
sudo gzip /var/games/nethack/1000bob
  
in the example:
+
This will create a file with the extension ".gz" or "<UIDusername>.gz". In the example "1000bob.gz".
  
sudo cp -p 1000bob.gz /var/games/nethack/save/
+
Then copy the file to the save directory:
  
*Finally. Hopefully, you can play now. Ask for [[freenode|help]] if this is too much for you.
+
sudo cp -p <playground><UIDusername>.gz <playground>/save/
  
===[[SLASH'EM]]===
+
In the example:
  
For SLASH'EM, it's almost the same as for nethack. Simply replace "nethack" with "slashem". So the example becomes:
+
sudo cp -p /var/games/nethack/1000bob.gz /var/games/nethack/save/
  
sudo /usr/lib/games/slashem/recover -d /var/games/slashem 1000bob
+
With luck, you can play now. Ask for [[Libera|help]] if not.
  
 
==External links==
 
==External links==
Line 96: Line 95:
  
 
[[Category:Utilities]]
 
[[Category:Utilities]]
 +
{{nethack-343}}

Latest revision as of 06:01, 30 December 2022

"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 Libera.

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

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.