Re: NIM: Initiate mksysb create from client???

From: Stephane GASSIES (sgassies_at_club-internet.fr)
Date: 05/03/04

  • Next message: erri: "Visual Age c++ does includes cc ?"
    Date: 03 May 2004 16:26:30 GMT
    
    

    Here is a tool you can use to re-create a boottable tape from a mksysb file.

    1) have the "mksysb-generated" file on one server of the same
    hardware & sofware as the one to restore (same server is better).

    # Start of script (call it as you want e.g. mk_sysb_tape)
    #!/usr/bin/ksh

    if [[ "H$1" = H-x ]] then
      extract=1
      shift
    else
      extract=0
    fi

    if [[ "H$1" = H+e ]] then
      eject=0
      shift
    else
      eject=1
    fi

    TAPE=${2:-rmt0}

    if [[ ! -f $1 || ! -r $1 || ! -w /dev/$TAPE.1 ]] then
      echo "Usage: $0 [-x] [+e] mksysb_file [tape drive]"
      exit 1
    fi

    Rc=0

    # If asked, get /image.data and /bosinst.data
    if (( $extract == 1 )) then
        cd /
        restore -xqvf $1 ./image.data || Rc=1
        (( Rc == 0 )) && { restore -xqvf $1 ./bosinst.data || Rc=2; }
        cd $OLDPWD
    fi

    # boot waiting a block_size of 512, we set it to 512 if not the case
    Bl=$(lsattr -EL $TAPE -a block_size -F value)
    if (( $Bl != 512 )) then
      Bl_change=1
      chdev -l $TAPE -a block_size=512
    else
      Bl_change=0
    fi

    # Here we go
    (( Rc == 0 )) && { bosboot -a -d /dev/$TAPE.1 || Rc=3; }
    (( Rc == 0 )) && { mkinstape /dev/$TAPE.1 || Rc=4; }
    (( Rc == 0 )) && {
      echo "Dummy tape TOC" | dd of=/dev/rmt0.1 bs=512 conv=sync || Rc=5; }
    (( Rc == 0 )) && { dd if=$1 of=/dev/$TAPE bs=1024 conv=sync || Rc=6; }

    (( Rc == 0 && eject == 1 )) && mt -f /dev/rmt0 rewoffl

    # Restore original block_size if changed
    (( Bl_change == 1 )) && chdev -l $TAPE -a block_size=$Bl

    exit $Rc

    # End of script

    Examples of use

       mk_sysb_tape /mksysb_backup_dir/mksysb_backup_file rmt1
       mk_sysb_tape -x /mksysb_backup_dir/mksysb_backup_file

    OBS: Thanks to a IBM guy (whom I forgot the name) for writing the
         original scriptt.

    Hope this will help.
    Regards,
    Stephane

    -- 
    Ce message a ete poste via la plateforme Web club-Internet.fr
    This message has been posted by the Web platform club-Internet.fr
    http://forums.club-internet.fr/
    

  • Next message: erri: "Visual Age c++ does includes cc ?"

    Relevant Pages

    • Re: Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
      (perl.beginners)
    • Re: Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
      (perl.beginners)
    • Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
      (perl.beginners)
    • Re: Regarding a selection for mobile code/scripting language
      ... Client Side scripting, so the server can send script commands to the client. ... I decided they should be scripted and mobile code. ...
      (Vuln-Dev)
    • Re: HTTPSConnection script fails, but only on some servers (long)
      ... (HTTP/CONNECT + switch to HTTPS) ... wget and my python script. ... >>The python script works with server A, ... the problem seems to depend on both the client ...
      (comp.lang.python)