Re: Call OnTape from a Perl script?
Posted in 2005
Diveman wrote:
> Hi guys,
You asked this already. OK, a more specific PERL answer. Paraphrasing from
an example from the book "Programming Perl", by Larry Wall, et al:
---------------------------------------------------------------------------
use IPC::Open2;
local( *Reader, *Writer );
$pid = open2(\\*Reader, \\*Writer, "ontape -s -L 0" );
chomp($prompt=<Reader>);
while ($sum = "Please mount tape [0-9]+ on [a-zA-Z\\\\_\\-:]+ and press Return
to continue")
{
print <Writer> "Y\\n";
chomp($prompt=<Reader>);
}
while ($sum = "Backup logical logs?")
{
print <Writer> "Y\\n";
chomp($prompt=<Reader>);
}
while ($sum = "Please mount tape [0-9]+ on [a-zA-Z\\\\_\\-:]+ and press Return
to continue")
{
print <Writer> "Y\\n";
chomp($prompt=<Reader>);
}
close Writer;
close Reader;
print $prompt;
----------------------------------------------------------------------------
Art S. Kagel
> Can anyone give me some advise how to call ontape from a Perl script?
> (Im running IDS7.31 on Win2000)
>
> Im trying something like this:
> system( "e:\\\\Informix\\\\ol_swedlive.cmd && ontape -s -L 0 \\<
> e:\\\\Informix\\\\scripts\\\\Enter.txt" );
>
> But, i get stuck on:
> Please mount tape 1 on L:Backserv\\Backup.dmp and press Return to
> continue,,,