SUMMARY: GNU tar + --multi-volume on HP C1553A

From: Mark (mark@lochard.com.au)
Date: Thu Oct 12 1995 - 13:01:20 CDT


re,

My orig post:

==============================================================================
We just got delivery of our C1553A 6 tape autoloader and I am wondering if any
one else has gotten this working on a Sol 2.x box using GNU tar and its multi
volume options. I am using these scripts:

sun:/home/admin/scripts root# cat stacker.backup
#!/bin/sh -x
/usr/local/bin/tar1118 -cf /dev/rmt/0n /home --multi-volume --new-volume-script=
/home/admin/scripts/next.tape --totals

sun:/home/admin/scripts root# cat next.tape
#!/bin/sh
/bin/mt -f /dev/rmt/0 rewoff
sleep 360
exit 0

As you can see I am using GNU tar 1.11.8, the 1.11.2 version seg faulted when
the tape was full. Unfortunately 1.11.8 did the same thing. What I was
expecting (and is documented in the 1.11.x manual) is the tar to execute the
next.tape script and then keep going.

If I manually run next.tape it works as expected, tar just doesnt like
reaching the EOT.

Who has gotten this device to work with GNU tar? (I dont want to hear about
networker or cpio or or ufsdump or bar or dd, just GNU tar).

In the mean time Im going to try to see if interactive prompting works, I can
expect(1) my way around it then.
==============================================================================

What I discovered was while GNU tar 1.11.{2,8} seg faulted on the
--info-script option, they did work correctly on manual prompting for the
user to change tapes and press return.

I did the obvious thing and wrote the following scripts:

=========================================
#!/usr/local/bin/expect
# Program : stacker.backup
# Version : 1.0
# Author : Mark <mark@lochard.com.au>
# Date : 12th Oct 1995
# Purpose : Hand hold GNUtar through multiple tape archiving

spawn sh -c "stty -echo; tar118 -cf /dev/rmt/0n /les --multi-volume --totals"
set timeout -1
set tapes_done 0
set finished 0
set next_tape /home/admin/scripts/next.tape

while {$finished == 0} {
    expect {
        eof {
            send_user "$argv0: tar finished of own accord\n"
            incr tapes_done
            incr finished
        }
        -re "Prepare volume #(.*) for (.*) and hit return:" {
            set next_volume $expect_out(1,string)
            set device $expect_out(2,string)
            incr tapes_done
            catch {system $next_tape} ignore
            send_user "\r\n";
            if {$tapes_done == 6} {
                set finished 1
                break
            }
            send "\r"
            exp_continue
        }
    }
}
send_user "$tapes_done tapes backed up\n"
=========================================

=========================================
#!/bin/sh
#
# Program : next.tape
# Author : Mark <mark@lochard.com.au>
# Date : 12th Oct 1995
# Purpose : execute commands to load the next tape into the HP C1553A

# Eject tape. DIP switch on drive set to eject and auto load next tape.
/bin/mt -f /dev/rmt/0 rewoff

# Sleep for a period of time to allow tape to settle in drive.
sleep 120
exit 0
=========================================

A sample output is given here:

sun:/home/admin/scripts root# stacker.backup
tar118 -cf /dev/rmt/0n /les --multi-volume --totals
tar118: Removing leading / from absolute path names in the archive
Prepare volume #2 for /dev/rmt/0n and hit return:
Prepare volume #3 for /dev/rmt/0n and hit return:
Prepare volume #4 for /dev/rmt/0n and hit return:
Prepare volume #5 for /dev/rmt/0n and hit return:
Prepare volume #6 for /dev/rmt/0n and hit return:
Total bytes written: 24943123432
stacker.backup: tar finished of own accord
6 tapes used in backup
sun:/home/admin/scripts root#

The next obvious thing is to patch GNU tar to not core dump and then to send
in the patches.

Cheers,
Mark
mark@lochard.com.au



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:34 CDT