[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

396.0. "Please, please, please..." by PUZZLE::JOSEPH (Let your spirits soar...) Tue Feb 03 1987 18:25

    Hi gang, this file has been in the Dcl_command procedures notes
    file for over a week with no luck.
    
    Am I going to be luckier here with the big guys... 
    
    Thanks in advance for your help.
    
    
    Regards,
    
    
    		Bob.
    
    
              <<< VAXUUM::SYS_:[NOTES$LIBRARY]COMMAND_PROCEDURES.NOTE;1 >>>
                         -<  DCL Command Procedures  >-
================================================================================
Note 298.0               Pls help me make it better...                No replies
PUZZLE::JOSEPH "Let your spirits soar..."           166 lines  29-JAN-1987 16:43
--------------------------------------------------------------------------------



Enclosed, please find a partial 'com' file that we used for our
weekly/daily BACKUP needs.

I'd like to put some enhancements to my current DCL and help
make the procedure work in more generic manner.

First of all ,I'd like the procedure to work for ALL SYSTEMS, ALL DISK
    DEVICE and ALL TAPE DEVICES...

Some of my major limitaions are:

	a.) I'm assuming a SIX characters node name (Ie JIGSAW$dua1, 
	USWR01$dra2, etc...   (PLease see portion of 'com' file...)
    
	I'd like to pick up the nedded devices regardless of node name.
	The kind of listing that I want to see are : DRA0, DUA1, DUB1, etc...)

	b.)I want to get the tape devices using the same concepts outlined
       above.
	   Ie : MFA1,MFA0,MUA0, etc...)



	I would also like to take a look at my DISK Devices and determined if 
	they are MENBERS OF A SHOWDOW SET and if they are NOT to bring them as
	part of the devices to be backed up.

	(Please see attached '$show dev d '

Device                  Device           Error    Volume         Free  Trans Mnt
 Name                   Status           Count     Label        Blocks Count Cnt
JIFFY$DJA0:             Mounted              0  AIC             392280     1   3
JIFFY$DJA1:             Mounted              0  TEST1           400095     1   3
JIFFY$DJA2:             Mounted              0  TEST2           400095     1   3
$2$DUA0:       (STERN)  ShadowSetMember      0  (member of $2$DUS0:)
$2$DUA1:       (STERN)  ShadowSetMember      0  (member of $2$DUS0:)
$2$DUA2:       (STERN)  Mounted              3  PSQUOR1         186960     3   3
$2$DUA3:       (STERN)  Mounted              2  VMSBKUP         220977     1   3
$2$DUA4:       (STERN)  ShadowSetMember      0  (member of $2$DUS4:)
$2$DUA5:       (STERN)  ShadowSetMember      0  (member of $2$DUS5:)
$2$DUA6:       (STERN)  ShadowSetMember      0  (member of $2$DUS4:)
$2$DUA7:       (STERN)  ShadowSetMember      0  (member of $2$DUS5:)
$2$DUA8:       (STERN)  ShadowSetMember      0  (member of $2$DUS8:)
$2$DUA9:       (STERN)  ShadowSetMember      0  (member of $2$DUS8:)
$2$DUA10:      (STERN)  Mounted              1  BACKUP1A        890934     1   3
$2$DUA11:      (STERN)  Mounted              6  BACKUP1B        890934     1   3
$2$DUA12:      (STERN)  Mounted              0  BACKUP2A        890934     1   3
$2$DUA13:      (STERN)  Mounted              0  BACKUP2B        890934     1   3
$2$DUA14:      (STERN)  Mounted              0  LIBRARY         890934     1   3
$2$DUA15:      (STERN)  Mounted              1  WORK1           615093     1   3
$2$DUA16:      (STERN)  Mounted              0  WORK2           890937     1   3
$2$DUA17:      (STERN)  Mounted              0  PRINT           890937     1   3
$2$DUS0:       (STERN)  Mounted              0  VAXVMSRL4       212442   112   3
$2$DUS4:       (STERN)  Mounted              0  DATA1           890937     1   3
$2$DUS5:       (STERN)  Mounted              0  DATA2           890937     1   3
$2$DUS8:       (STERN)  Mounted              0  REFDATA         890928     1   3

       Please feel free to suggest any other changes/ideas that you
       may have  .
	***********************************************************

                  Portion of cammand file...
    
$ TAPE_FIND:
$   OPEN/READ TAPE_X 'TAPE_INFO'
$   READ TAPE_X DEVICE
$   READ TAPE_X DEVICE
$   READ TAPE_X DEVICE
$   COUNTER = 1
$!
$ TAPE_READ_LOOP:
$   READ/END_OF_FILE=TAPE_READ_LOOP_END TAPE_X DEVICE
$   TAPE_'COUNTER' = F$EXTRACT(7,4,DEVICE)
$   COUNTER = COUNTER + 1
$   GOTO TAPE_READ_LOOP
$!
$ TAPE_READ_LOOP_END:
$   TAPE_CNT = COUNTER - 1
$   CLOSE TAPE_X
$   DELETE 'TAPE_INFO'
$!
$! ** DISPLAY AVAILABLE TAPE DRIVES **
$!
$ TAPE_NEW: 
$   COUNTER = 1
$   WRT "THESE ARE THE TAPE DRIVES"
$ TAPE_DISPLAY:
$   WRT TAPE_'COUNTER'
$   COUNTER = COUNTER + 1
$   IF COUNTER .GT. TAPE_CNT THEN GOTO TAPE_INQUIRE
$   GOTO TAPE_DISPLAY
$!
$! ** INQUIRE AS TO WHICH TAPE DRIVE **
$!
$ TAPE_INQUIRE:
$   COUNTER = 1
$   Inquire TAPE "Please enter tape drive to be used  "
$   TAPE = TAPE - ":" 
$ TAPE_CK:
$   IF TAPE .EQS. TAPE_'COUNTER' THEN GOTO DISK_FIND
$   COUNTER = COUNTER + 1
$   IF COUNTER .GT. TAPE_CNT THEN GOTO TAPE_ERR
$   GOTO TAPE_CK
$!
$!
$! ** LOCATE AVAILABLE DISK DRIVES **
$!
$ DISK_FIND:
$   OPEN/READ DISK_X 'DISK_INFO'
$   READ DISK_X DEVICE
$   READ DISK_X DEVICE
$   READ DISK_X DEVICE
$   COUNTER = 1
$!
$ DISK_READ_LOOP:
$   READ/END_OF_FILE=DISK_READ_LOOP_END DISK_X DEVICE
$   DISK_'COUNTER' = F$EXTRACT(7,4,DEVICE)
$   COUNTER = COUNTER + 1
$   GOTO DISK_READ_LOOP
$!
$ DISK_READ_LOOP_END:
$   DISK_CNT = COUNTER - 1
$   CLOSE DISK_X
$   DELETE 'DISK_INFO'
$!
$ DISK_NEW:
$   WRT "These are the disk drives to back up"
$   COUNTER = 1
$ DISK_DISPLAY:
$   WRT DISK_'COUNTER'
$   COUNTER = COUNTER + 1
$   IF COUNTER .GT. DISK_CNT THEN GOTO DISK_INQUIRE
$   GOTO DISK_DISPLAY
$ DISK_INQUIRE:
$   Inquire DISK "Please enter disk drive to back up  "
$   COUNTER = 1
$ DISK_CK:
$   DISK = DISK - ":"
$   IF DISK .EQS. DISK_'COUNTER' THEN GOTO DAY_CK
$   COUNTER = COUNTER + 1
$   IF COUNTER .GT. DISK_CNT THEN GOTO DISK_ERR
$   GOTO DISK_CK
$!




	****************************************************


Device                  Device           Error    Volume         Free  Trans Mnt
 Name                   Status           Count     Label        Blocks Count Cnt
$2$MUA0:         (BOW)  Online               0
$2$MUA1:         (BOW)  Online               0



As always, thanks in advance for your help.

		Regards,


			Bob.

T.RTitleUserPersonal
Name
DateLines
396.1MOTHRA::DUTKONestor Dutko, VMS/VAXclusters CSSETue Feb 03 1987 19:0017
    Well, as for the determination of shadow sets, all you have to do
    is use the Lexical function F$GETDVI.  
    
    If you specify the item code of SHDW_MEMBER, it will return a value 
    of true if the device is a member of a shadow set.  If you follow the 
    F$GETDVI for the determination of membership within a shadowset,
    you can use F$GETDVI this time using the item code SHDW_MASTER_NAME
    which will return the name of the DUS device.
    
    That is a start.  
    
    As for your specifying just MFA0:, I can't think of any method off
    the top of my head for getting the full device name without having
    to get the output of SHOW DEVICE MF, Followed by a SHOW DEVICE MT
    and parse out the information within the file...
    
    Sorry, but at least you have a start...
396.2helping on TAPESBARNA::SOLEPONTWed Feb 04 1987 06:356
		    $ ALLOCATE   MF,MU,MT,MS,etc   TAPE

	Just put controller names in preferred order (no matter if they
	do not exist) and use TAPE as device name in BACKUP command.

	*Jaume
396.3Any other suggestions pls...PUZZLE::JOSEPHLet your spirits soar...Wed Feb 04 1987 16:4514
   
    Re:1.
    Thanks for your quick response Nestor. I'll start with the Lexical
    F$getdvi and see what happen.
         
    Re:2
    
    Thnk for your on ALLOCATE, but this is not truly what I'm looking
    for. But, thanks anyhow.
    
    
    Once again ,thanks for your help.
    
    Bob
396.4Our wayUSHS01::BLANDOFri Feb 06 1987 12:4415
    Our backup procedure does a SHOW DEVICE/OUTPUT=File_name.  Then
    It uses DCL to open the file, and read every line.  It disgards
    blank lines, and uses F$ELEMENT(0," ",F$EDIT(LINE,"COMPRESS,TRIM"))
    to get the first word in the list.  Then a F$GETDVI(WORD,"EXISTS")
    allows it to disgard titles and non-devices line.  Then an
    F$GETDVI(WORD,"DEVCLASS") allos us to determine the device type
    (DC$_DISK, DC$_TAPE, DC$_XXXX)  Then more F$GETDVI to find shadow
    sets, removable disks, and so on...
                                 
    
    FJBlando
    
    P.S.	If you want a copy of it, send me mail, but it is 1200
    lines long because it is fairly general, and also handles backup
    over DECnet onto tapes and ...
396.5I can't THANK you enough...PUZZLE::JOSEPHLet your spirits soar...Fri Feb 06 1987 21:545
    Thanks a lot pal, I'll send you a vaxmail for further info.
    
    Regards,
    
    	Bob