cataloging a tape - SUN

This is a discussion on cataloging a tape - SUN ; Hi, The following script creates a cataloge file that contains a file listing all of the files in each session on the tape.(I think, but not tested it yet) export TAPE=/dev/rmt/0n for i in 0 1 2 3 4 5 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: cataloging a tape

  1. cataloging a tape

    Hi,

    The following script creates a cataloge file that contains a file
    listing all of the files in each session on the tape.(I think, but not
    tested it yet)

    export TAPE=/dev/rmt/0n
    for i in 0 1 2 3 4 5
    do
    mt asf $i
    ufsrestore tf "$TAPE" > dumpfile_$i.cat
    done


    I want to do a similar thing but grab the output of the "what" command
    from within a "ufsrestore i".

    So I have a file containing

    Dump date: Mon Nov 02 10:59:15 1998
    Dumped from: TestSRV
    level 0 dump of / on hostname:/dev/dsk/c0t1d0s0
    Label: none

    Dump date: Mon Nov 02 10:59:15 1998
    Dumped from: TestSRV
    level 0 dump of /var on hostname:/dev/dsk/c0t1d0s6
    Label: none
    .....

    Does anyone know if this is possible ? Ideally I would like to add a
    small header so I know which entry relates to what session on the tape.

    Sorry scripting is not my strong point, your help is appreciated.

    Thanks

    Paul

  2. Re: cataloging a tape

    me wrote:

    >export TAPE=/dev/rmt/0n
    > for i in 0 1 2 3 4 5
    > do
    > mt asf $i
    > ufsrestore tf "$TAPE" > dumpfile_$i.cat
    > done


    >I want to do a similar thing but grab the output of the "what" command
    >from within a "ufsrestore i".


    First of all, "mt asf" is not a good idea here cause this actually rewinds
    the tape and then forwards it to file $i every time. Moreover, you wouldn't
    have to position the tape at all if you used the "n" device only _once_.


    TAPE=/dev/rmt/0n
    mt rewind
    for i in 0 1 2 3 4 5; do
    echo "what" | ufsrestore if $TAPE > dumpfile_$i.cat
    mt bsf
    ufsrestore tf $TAPE >> dumpfile_$i.cat
    done


    >So I have a file containing


    You want the header in a different file? So just change the file name in
    the first command.

    HTH

    fw

  3. Re: cataloging a tape

    In <58r9tuF2ieb7fU1@mid.individual.net> Frank Winkler writes:

    >me wrote:


    > >export TAPE=/dev/rmt/0n
    > > for i in 0 1 2 3 4 5
    > > do
    > > mt asf $i
    > > ufsrestore tf "$TAPE" > dumpfile_$i.cat
    > > done


    > >I want to do a similar thing but grab the output of the "what" command
    > >from within a "ufsrestore i".


    >First of all, "mt asf" is not a good idea here cause this actually rewinds
    >the tape and then forwards it to file $i every time. Moreover, you wouldn't
    >have to position the tape at all if you used the "n" device only _once_.


    Rubbish! The rmt driver keeps track of where you are on the tape, and
    optimizes 'mt asf' accordingly.

    In fact, the driver is so good at knowing where you are on the tape that
    it actively prevents you doing useful things, like asf'ing to some point
    and then trying to overwrite the next file (which was the dump that had
    just failed and you want to repeat it without starting on a new tape).

    --
    Charles H. Lindsey ---------At Home, doing my own thing------------------------
    Tel: +44 161 436 6131 Fax: +44 161 436 6133 Web: http://www.cs.man.ac.uk/~chl
    Email: chl@clerew.man.ac.uk Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
    PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5

  4. Re: cataloging a tape

    Charles Lindsey wrote:
    > In <58r9tuF2ieb7fU1@mid.individual.net> Frank Winkler writes:
    >
    >> me wrote:

    >
    >> >export TAPE=/dev/rmt/0n
    >> > for i in 0 1 2 3 4 5
    >> > do
    >> > mt asf $i
    >> > ufsrestore tf "$TAPE" > dumpfile_$i.cat
    >> > done

    >
    >> >I want to do a similar thing but grab the output of the "what" command
    >> >from within a "ufsrestore i".

    >
    >> First of all, "mt asf" is not a good idea here cause this actually rewinds
    >> the tape and then forwards it to file $i every time. Moreover, you wouldn't
    >> have to position the tape at all if you used the "n" device only _once_.

    >
    > Rubbish! The rmt driver keeps track of where you are on the tape, and
    > optimizes 'mt asf' accordingly.
    >
    > In fact, the driver is so good at knowing where you are on the tape that
    > it actively prevents you doing useful things, like asf'ing to some point
    > and then trying to overwrite the next file (which was the dump that had
    > just failed and you want to repeat it without starting on a new tape).
    >

    Hi,

    I am just trying the above script but it only does on round of the loop

    "tapecat.sh" 15 lines, 235 characters
    # ./tapecat.sh
    Cataloging a tape
    Vendor 'COMPAQ ' Product 'DLT8000 ' tape drive:
    sense key(0x0)= No Additional Sense residual= 0 retries= 0
    file no= 0 block no= 0
    ufsrestore > Dump date: Thu Mar 30 18:00:01 2006
    Dumped from: the epoch
    Level 0 dump of /ckp on revenues:/dev/md/dsk/d8
    Label: none
    ufsrestore >

    I need to beable to send the quit command here to progress onto the next
    session. How do I pipe the word quit into this prompt ?

    Thanks

    Paul

  5. Re: cataloging a tape

    me wrote:
    > Charles Lindsey wrote:
    >> In <58r9tuF2ieb7fU1@mid.individual.net> Frank Winkler
    >> writes:
    >>
    >>> me wrote:

    >>
    >>> >export TAPE=/dev/rmt/0n
    >>> > for i in 0 1 2 3 4 5
    >>> > do
    >>> > mt asf $i
    >>> > ufsrestore tf "$TAPE" > dumpfile_$i.cat
    >>> > done

    >>
    >>> >I want to do a similar thing but grab the output of the "what" command
    >>> >from within a "ufsrestore i".

    >>
    >>> First of all, "mt asf" is not a good idea here cause this actually
    >>> rewinds the tape and then forwards it to file $i every time.
    >>> Moreover, you wouldn't have to position the tape at all if you used
    >>> the "n" device only _once_.

    >>
    >> Rubbish! The rmt driver keeps track of where you are on the tape, and
    >> optimizes 'mt asf' accordingly.
    >>
    >> In fact, the driver is so good at knowing where you are on the tape that
    >> it actively prevents you doing useful things, like asf'ing to some point
    >> and then trying to overwrite the next file (which was the dump that had
    >> just failed and you want to repeat it without starting on a new tape).
    >>

    > Hi,
    >
    > I am just trying the above script but it only does on round of the loop
    >
    > "tapecat.sh" 15 lines, 235 characters
    > # ./tapecat.sh
    > Cataloging a tape
    > Vendor 'COMPAQ ' Product 'DLT8000 ' tape drive:
    > sense key(0x0)= No Additional Sense residual= 0 retries= 0
    > file no= 0 block no= 0
    > ufsrestore > Dump date: Thu Mar 30 18:00:01 2006
    > Dumped from: the epoch
    > Level 0 dump of /ckp on revenues:/dev/md/dsk/d8
    > Label: none
    > ufsrestore >
    >
    > I need to beable to send the quit command here to progress onto the next
    > session. How do I pipe the word quit into this prompt ?
    >
    > Thanks
    >
    > Paul


    and the answer is
    echo "quit\c"|ufsrestore -ivf $TAPE 2>/dev/null|grep "ump"

    found @
    http://members.tripod.com/dennis_caparas/Make_Index.htm

+ Reply to Thread