Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!decvax!ucbvax!YALE.ARPA!LEICHTER-JERRY
From: LEICHTER-JERRY@YALE.ARPA.UUCP
Newsgroups: mod.computers.vax
Subject: Re: Help with BACKUP/INTERCHANGE format ?
Message-ID: <8612201827.AA16062@ucbvax.Berkeley.EDU>
Date: Sat, 20-Dec-86 13:27:54 EST
Article-I.D.: ucbvax.8612201827.AA16062
Posted: Sat Dec 20 13:27:54 1986
Date-Received: Sat, 20-Dec-86 15:35:55 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: 
Organization: The ARPA Internet
Lines: 60
Approved: info-vax@sri-kl.arpa


    I have a VMS BACKUP tape.... I'd like to recover the original directory
    structure, but BACKUP wants to read all the files into the directory I
    specified on the BACKUP command.  That is, if I do:
    
        BACKUP/REWIND/LOG MSA0: DUB0:[TAPE]
    
    it reads all the files into the top-level directory [TAPE], instead of
    creating them in sub-directories where they should be....
BACKUP is doing exactly what you asked it to do:  By specifying a particular,
non-wildcarded directory in the output spec, you have asked that the files be
restored to that directory, and that directory only.

The correct output spec depends on exactly what you want to accomplish.  If
you want the files to go back to EXACTLY the directories they came from, do:

1.        BACKUP/REWIND/LOG MSA0: DUB0:[*...]

Alternatively, if you want to build a new directory structure under [TAPE]
that is similar to the original directory tree, do:

2.        BACKUP/REWIND/LOG MSA0: DUB0:[TAPE...]

Then again, if you want to build a the directory structure under the current
default directory, you can do:

3.        BACKUP/REWIND/LOG MSA0: DUB0:[...]

Method 1 has a problem previously discussed on this list:  It requires R
access to the MFD (directory [000000]).  Many systems provide only E access.
Suppose the files on the tape are in [LEICHTER...].  If I use form 2, they
end up in [TAPE.LEICHTER...].  That looks reasonable, but suppose I want to
put my own files back in my own directory tree.  So I try:

2'.       BACKUP/REWIND/LOG MSA0: DUB0:[LEICHTER...]

Now they end up in [LEICHTER.LEICHTER...]!  (Compare to case 2.)  The follow-
ing non-obvious command puts the files where they belong:

2''.      BACKUP/REWIND/LOG MSA0:/SELECT:[LEICHTER...] DUB0:[LEICHTER...]

The reason for this is messy but clear when you understand it - which I did
once when it was explained to me, but have gotten fuzzy on.  Let's see now.
Basically, BACKUP starts with an input and an output spec.  It splits each
into a leading fixed part and a trailing wild part.  It then tries to match
the parts up.  The default input spec is [*...], which has a null fixed part
and [*...] as the wild part.  In 2', the output has fixed part [LEICHTER],
wild part [...].  The null fixed part (i.e., "the root") matches [LEICHTER],
and the [*...] matches [...].  So a whole tree, starting with [.LEICHTER], is
built in [LEICHTER].  On the other hand, in 2'', the fixed input part is
[LEICHTER], which matches [LEICHTER], and one level of the directory spec
gets stripped off.

In general, it's easy to understand what BACKUP is doing when it is CREATING
a saveset; the confusion is on restoration, where it's not always obvious
what the input and output specs are.  In fact, the same rules are followed
both ways - but it's been my experience that you have to experiment some times
to get exactly the effect you want.
							-- Jerry
-------