From:	CSBVAX::MRGATE!INFO-VAX-RELAY@KL.SRI.COM@SMTP 19-JUN-1988 23:46
To:	ARISIA::EVERHART
Subj:	BITNET Mail follows


Received: from CUNYVM.CUNY.EDU by KL.SRI.COM with TCP; Thu, 16 Jun 88 07:07:22 PDT
Received: from NIHKLMB.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with BSMTP id 1052; Thu, 16 Jun 88 09:32:00 EDT
Date: 16 JUN 88 09:26
From: GHC%NIHKLMB.BITNET@CUNYVM.CUNY.EDU
To: INFO-VAX @ KL.SRI.COM
Subject: BITNET Mail follows

Date: 16-JUN-1988 09:24:45.28
From: Gerson H Cohen <GHC@NIHKLMB>
To  : <info-vax@kl.sri.COM>
Original To: GATEWAY::"info-vax@kl.sri.com"
Subj: RE: Moving users to a new Vax

In reply to a query from SYSMAN@NMSUNM1.BITNET Re: Moving users to a new Vax
I have suggested the following.  I am reposting it to the list because of the
usefull command procedure which I included in the response.
============================================================================
From:   VGER::GHC          "Gerson H Cohen" 16-JUN-1988 09:16
To:     GATEWAY::"sysman@nmsuvm1",GHC
Subj:   Re: Moving users to a new Vax

I have done almost exactly what you require, excepting that several of my
drives came along onto the new system.  If you don't bring any drives,
you'll have to copy the system disk (image mode) onto tape and restore it
on the new machine.  As for copying quotas, I have a procedure (originally
from a DECUS symposium tape which I am attaching.  Execute it on each of
your current drives and then execute to resultant command file on the new
machine.  BTW - I use it from time to time to record tha quotas on each on
my devices in case I loose a drive and have to recreate what was there on
a new pack.

GHC
---------------------------------------------------------------------------
$ verify = 'F$VERIFY(0)'
$ GOTO L1$
$!
$! DISKQUOTA.COM
$!
$! This command procedure will extract the currently set disk quotas for
$! a disk volume and prepare a command file to be used to restore those quotas.
$! The two parameters give the disk name with the volume whose quotas are to
$! be scanned and the file name for the command file to be used to restore the
$! quotas.  This command procedure is used because the BACKUP utility will not
$! allow the QUOTA.SYS file to be saved online.
$!+ DISKQUOTA
$! The DISKQUOTA command procedure will create a command file to
$! restore the current disk quota settings (using the DISKQUOTA program).
$! Execute the command procedure by doing:
$!
$!      @D$:DISKQUOTA  device[:]  [file_spec]
$!
$! The output file specification defaults are taken from
$! SYS$DISK:QUOTAS.COM.
$!-
$! Created:     Frank J. Nagy   9-Oct-81        Fermilab Accelerator Controls
$!
$! Modifications:
$!  11-Apr-82   FJN     Cleaned up use of VER_MODE
$!  30-Aug-82   FJN     Use VMS V3 features
$!  03-Sep-82   FJN     Remove ";" added by F$PARSE
$!  21-Jul-87   GHC     Check for UIC by character string
$!=============================================================================
$L1$:
$!
$! If no P1 parameter specified, exit.  If p1 is given, remove any trailing
$! colons.
$!
$ IF p1 .EQS. "" THEN $ EXIT    F$VERIFY(verify).OR.1
$ p1 = p1 - ":"
$!
$! Set default for file specification parameter.
$!
$ p2 = F$PARSE(p2,"SYS$DISK:QUOTAS.COM") - ";"
$!
$! Create temporary command file to run DISKQUOTA
$!
$ OPEN/WRITE  OUT:  DISKQUOTA.TMP
$ WRITE OUT: "$ RUN SYS$SYSTEM:DISKQUOTA"
$ WRITE OUT: "USE ",p1
$ WRITE OUT: "SHOW [*,*]"
$ WRITE OUT: "EXIT"
$ CLOSE OUT:
$!
$! Run DISKQUOTA to get disk space allocated by UIC
$!
$@DISKQUOTA.TMP/OUTPUT=DISKSPACE.TMP
$ DELETE DISKQUOTA.TMP;*
$!
$! Sort into order by UIC
$!
$ SORT/KEY=(POS:2,SIZE:6,NUMBER:1)/KEY=(POS:9,SIZE:6,NUMBER:2) -
        DISKSPACE.TMP   DISKSPACE.TMP
$ PURGE DISKSPACE.TMP
$!
$! Now read the DISKQUOTA output file and setup the restoring command file.
$!
$ OPEN/READ/ERR=ERR_NO_DISK  SPACE:  DISKSPACE.TMP
$ OPEN/WRITE/ERR=ERR_NO_WRITE  RESTORER:  'P2'
$ ON CONTROL_Y THEN $ GOTO EXIT_ALL
$ ON ERROR THEN $ GOTO EXIT_ALL
$!
$!  Skip first record in disk space file
$!
$ READ  SPACE:  DUMMY
$!
$! First lines of restorer are to RUN DISKQUOTA and USE the disk and to
$! CREATE the QUOTA.SYS file.
$!
$ WRITE RESTORER: "$ RUN SYS$SYSTEM:DISKQUOTA"
$ WRITE RESTORER: "USE ",P1
$ WRITE RESTORER: "CREATE"
$!
$! Loop reading the DISKQUOTA output file and writing the restorer file
$!
$LOOP:
$       READ/END=EOF_SPACE  SPACE:  space_buf
$       uic_space = F$EXTRACT(0,16,space_buf)
$!
$! Check for [0,0].  If so then operation is "MOD", else operation is "ADD"
$!
$       op_type = "ADD"                         !Default operation type
$       IF F$EXTRACT(0,5,uic_space) .EQS. "[0,0]" THEN -
                op_type = "MOD"
$!
$! Get quota values from input
$!
$       uic_perm = F$EXTRACT(31,10,space_buf)
$       uic_over = F$EXTRACT(49,10,space_buf)
$       WRITE RESTORER: -
                op_type," ",uic_space,"/PERM=",uic_perm,"/OVER=",uic_over
$       GOTO LOOP
$!
$! All done with input
$!
$ EOF_SPACE:
$!
$ EXIT_ALL:
$ CLOSE SPACE:
$!
$!  End the restorer command file.
$!
$ WRITE RESTORER: "REBUILD"
$ WRITE RESTORER: "EXIT"
$ CLOSE RESTORER:
$!
$! Cleanup
$!
$ DELETE DISKSPACE.TMP;*
$ PURGE 'P2'
$ EXIT  F$VERIFY(verify).OR.1
$!
$!  Error Messages
$!
$!
$ ERR_NO_DISK:
$ WRITE SYS$OUTPUT "%DISKUSAGE-F-NO_DISK, no disk space file found."
$ GOTO EXIT_ALL
$!
$ ERR_NO_WRITE:
$ WRITE SYS$OUTPUT "%DISKUSAGE-F-NOWRITE, restorer command file not opened."
$ GOTO EXIT_ALL
$!
