Solved

Nvi recovery program

Posted on 2006-07-13
3
657 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now