Professional Web Applications Themes

erasing last file on cartridge tape - Sun Solaris

I have a little script that does basically this: for var in a b c d e f g; do tar cf /dev/rmt/0bn dir-$var done Now, occasionally the tape will get full, e.g. at step 'e' in the above step. So the tape is ejected, and a new tape is put in, and step 'e' is restarted. That's all fine. But I'd like to make the script a little smarter, i.e. I'd like it to remove the incomplete data written to the first tape in the first attempt of step 'e' from the full tape. My idea is: at the ...

  1. #1

    Default erasing last file on cartridge tape

    I have a little script that does basically this:

    for var in a b c d e f g; do
    tar cf /dev/rmt/0bn dir-$var
    done

    Now, occasionally the tape will get full, e.g. at step 'e' in the
    above step. So the tape is ejected, and a new tape is put in, and
    step 'e' is restarted.

    That's all fine. But I'd like to make the script a little smarter, i.e.
    I'd like it to remove the incomplete data written to the first tape in
    the first attempt of step 'e' from the full tape.

    My idea is: at the point where tar returns an error (generally meaning
    that the tape is full) the script will "mt bsf" some number of times so that
    the next write would overwrite the 'e' step. Then I could "mt eof". Then
    there should be two eof's in a row at that point on the tape, preventing
    someone from reading the incomplete 'e' step. Right?

    Now here's my question. Supposing I do this. What happens if I then do
    "mt eom" on the 1st tape? Will I be able to write a smaller dataset to
    the tape?

    I'm going to experiment myself a bit, but of course it will be time-consuming,
    so any hints anyone could give may save me some time.

    Thanks!

    --
    Griff Miller II | |
    Manager of Information Technology | "I need to be the owner of all of |
    Positron Corporation | the files in /usr/kvm." |
    com | |
    Griff Guest

  2. #2

    Default Re: erasing last file on cartridge tape

    Griff Miller <com> wrote: 
     
     

    Okay...
     
     

    Pretty much. It's not the "two eofs in a row" that prevents the reads.
    It's the fact that after you write *anything* on the tape, then close,
    the tape drive will write a special mark on the tape (eom) after the
    write. The drive will not advance past that mark.
     

    By one eof, yes. You have to write *something* after the 'd' dataset,
    and that something will take some space on the tape.

    If you knew that something was there, you could backup over it, and
    begin writing on top of it to get your (tiny) space back. That might be
    more logic than you want over simply going to eom and writing there.

    If you have your two consecutive EOFs, then you'd have to issue an extra
    fsf to get past the second one, even though there is no data between
    them.

    --
    Darren Dunham com
    Unix System Administrator Taos - The SysAdmin Company
    Got some Dr Pepper? San Francisco, CA bay area
    < This line left intentionally blank to confuse you. >
    Darren Guest

  3. #3

    Default Re: erasing last file on cartridge tape

    Griff Miller <com> wrote: 

    Sorry, I just now understood what you were asking. You were assuming
    the two eof's would prevent access. They do not.

    Yes, you can go to eom and write whatever you want, subject to remaining
    tape space.

    --
    Darren Dunham com
    Unix System Administrator Taos - The SysAdmin Company
    Got some Dr Pepper? San Francisco, CA bay area
    < This line left intentionally blank to confuse you. >
    Darren Guest

Similar Threads

  1. Utlization of a Tape Cartridge
    By Chandan in forum AIX
    Replies: 2
    Last Post: October 5th, 09:37 AM
  2. App for erasing CDs? (not cdrw's)
    By DaveC in forum Mac Applications & Software
    Replies: 36
    Last Post: October 4th, 06:38 PM
  3. Copying A Single File From Tape Backup
    By Elliot J in forum SCO
    Replies: 1
    Last Post: July 7th, 01:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139