Solved

Nvi recovery program

Posted on 2006-07-13
3
663 Views
Last Modified: 2013-12-16
I was editing an index.html page this morning on a remote Debian 3.1 server using vi, which I now know is nvi (I assumed it was vim, which I'm used to from other distros). I forgot to save the file and closed my SSH client.

I then received an e-mail as follows:

--------8<--------
From: Nvi recovery program [mailto:root@myhost.mysubnet]
Sent: 13 July 2006 09:55
To: rstaveley@myhost.mysubnet
Subject: Nvi saved the file index.html

On Thu Jul 13 08:54:11 2006, the user rstaveley was editing a file named index.html on the machine myhost.mysubnet, when it was saved for recovery. You can recover most, if not all, of the changes to this file using the -r option to vi:

      vi -r index.html
--------8<--------

I'm absolutely delighted with this. I fixed my error straight away.

Here's my question:

The company I work for uses pico for on-line text editing, because most people are more enlightened than I am. Does the equivalent of the Nvi recovery program exist for pico too, including the mail alert?
0
Comment
Question by:rstaveley
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
pjedmond earned 125 total points
ID: 17098153
No it does not:(

However, if you use the command:

screen

before running pico, even if you get disconnected, you wont lose your work. On reconnecting, you type:

screen -r

or you may have to give:

screen -r screenid

and you are back to where you were before you were disconnected.

(   (()
(`-' _\
 ''  ''
0
 
LVL 17

Author Comment

by:rstaveley
ID: 17098221
That's very cool.

I've just tried putting the following into ~/.profile:

   screen -r || screen

It is nice, but doesn't handle screen resizes. The mail alert is what really tickled my fancy about nvi, though.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17098280
Pico (and nano)...are designed to be 'minimalistic' editors, hence their name! I think it unlikely that they would add such a function if the editor edited with an error. Even if it did, pico doesn't have any 'auto-backup' of progress process I'm afraid, so you wouldn't be able to recover anything.

>It is nice, but doesn't handle screen resizes.

Upgrade your version of screen. Although when you resize, it doesn't correctly fill additional blank space, the never versions of it definitely use the full 'screen' size.

(   (()
(`-' _\
 ''  ''

0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question