HI,
I beg your pardon but my previus SUMMARY 2 about this topic has wrongly
been sent before it was completely written.
In my previous SUMMARY I did report the way in which automatically make
vdumps on tz885 using expect to change tapes when need.
Please note that in the expect script must added the following line:
set timeout -1
so the resulting script is as follows:
#!/usr/local/bin/expect
set timeout -1
spawn /sbin/vdump -0f /dev/nrmt2h /clone
set processo $spawn_id
send_user "\n started process $processo\n"
expect {
"vdump: Press RETURN when tape is mounted..." \
{send_user "\n it asked for next tape\n";sleep 60;send "
\r";exp_continue}
eof {send_user "\n EOF found ! \n"}
}
send_user "\n process $processo ENDED !\n"
Then after I wrongly wrote that dd does'nt waits for tapes to be
changed when the end of media is reached so that we can'nt dump
remotely since we need dd for doing that.
/sbin/vdump 0bf 64 - /clone | rsh remotehost "dd of=/dev/nrmt2h bs=65536"
Alan Rollow let me notice that dd does ask for new tapes:
dd: Reached end of medium for /dev/nrmt2h; Please wait for file closing
dd: Insert next volume and press RETURN key. [q]
So he suggested to use expect to intercept the above message when
dumping to a remote device using rsh in the above way.
But I did'nt succeded.
Due to the fact that a pipe is needed the above command cannot be given
directly to the expect command spawn. It has to become a script which
will be executed by the spawn. Let's name this script dd.sh
cat dd.sh
/sbin/vdump 0bf 64 - /clone | rsh remotehost "dd of=/dev/nrmt2h bs=65536"
cat dd.exp
#!/usr/local/bin/expect
set timeout -1
spawn ./dd.sh
set processo $spawn_id
send_user "\n started process $processo\n"
expect {
"dd: Insert next volume and press RETURN key. " \
{send_user "\nit asked for next tape\n"; \
system "robot show slot;mt -f /dev/nrmt2h offline; robot show slot";sleep 60; \
send " \r" ;send_user "I hit return"; exp_continue}
eof {send_user "\nEOF found ! \n"}
}
send_user "\n process $processo ENDED !\n"
BUT when executing dd.exp script it happens as follows:
expect dd.exp
spawn ./spawn.sh
started process 4
path : /clone
dev/fset : raid0#f1_clone
type : advfs
advfs id : 0x32f9e7d6.00035600.6
vdump: Date of last level 0 dump: the start of the epoch
vdump: Dumping directories
vdump: Dumping 3723456968 bytes, 1315 directories, 30680 files
vdump: Dumping regular files
.......
.......
vdump: Status at Wed Oct 7 10:09:38 1998
vdump: Dumped 2124346383 of 3723456968 bytes; 57.1% completed
vdump: Dumped 625 of 1315 directories; 47.5% completed
vdump: Dumped 10624 of 30680 files; 34.6% completed
Reached end of medium for /dev/nrmt2h; Please wait for file closing
Cannot prompt (can't open /dev/tty): No such device or address
EOF found !
process 4 ENDED !
So it seems that in some way with expect & rsh I loose the ability to
interact with the remotely executed dd command
Furthermore I found out that when expect spawns a command there is no
way to get the return code of the command itself. Is that true ?
Any ideas ?
Thanks to all,
Emanuele
--
Emanuele Lombardi
mail: AMB-GEM-CLIM ENEA Casaccia
I-00060 S.M. di Galeria (RM) ITALY
mailto:lele_at_mantegna.casaccia.enea.it
tel +39 6 30483366 fax +39 6 30483591
This transmission was made possible by 100% recycled electrons.
Here my original question:
> Dear axp-ists,
>
> I just buyed a tz885 DLT tape drive with 5 slots.
> I installed it on my Dunix 4.0d alpha server ,
> BUT
> I'm not able to make a vdump which automatically changes the tapes when
> the end of one is reached.
>
> I've succesfully installed Media Robot Utility V1.2 and the
> SCSI CAM Medium Changer Driver V3.1C (CLCMC313 subset).
> The robot and xrobot commands works perfectely and I can move tapes
> from each slot to the drive and viceversa.
>
> I made 2 devices:
> /dev/mc20b which is the changer
> /dev/rmt2h which is the tape drive
>
> I make dumps as follows:
> vdump 0f /dev/nrmt2h /fileset
>
> but end of media is reached at th end of the tape which is actually
> loaded in the drive. There is not AUTOMATIC moving of tapes from the
> next slot to the drive!
>
> here what I get from scu
>
> scu show edt bus 2
>
> CAM Equipment Device Table (EDT) Information:
>
> Device: TZ885 Bus: 2, Target: 4, Lun: 0, Type: Sequential Access
> Device: TZ Media Changer Bus: 2, Target: 4, Lun: 1, Type: Medium Changer
>
> If I try to vdump to /dev/mc20b device I get errors
> write error: No such device
>
> vdump: unable to write to save-set; [19] No such device
>
> Any suggestion ?
>
> Thanks to all from Italy,
>
> Emanuele
Received on Wed Oct 07 1998 - 09:33:56 NZDT