In the script I open up two Telnet sessions. The first one is to dump the database. The second one is to dump the tran log both commands use the same backup.pl script the only difference is that to dump the tran you pass it the "Backup.Type=tran" parameter. Dumping the database works fine but when you backup the database the script returns an information message "Dumping database $dbname". for this session I have a waitfor(Dumping database) that seems to make it wait long enough to finish the command. When you dump the tran it returns nothing so I am not able to find a match on that command that I can waitfor.
here is the code
This part works fine.
my $th = new Net::Telnet (input_log => "$dir/$log",
dump_log => (*STDOUT),
Host => "$server",
Prompt => '/sybase?/');
$th->login("user", "$unixpass");
my @lines = $th->cmd("backup_sybase.pl Server.Name=$dbsrvr Backup.Data
+base=$cltdb");
$th->waitfor('/Dumping database/');
print @lines;
$th->waitfor('/sybase?/');
print @lines;
print "******DUMPING $cltdb TRANSACTION******\n";
This part does not work.
my $th = new Net::Telnet (input_log => "$dir/$log",
dump_log => (*STDOUT),
Host => "$server",
Prompt => '/sybase?/');
$th->login("user", "$unixpass");
my @lines = $th->cmd(String => ("backup.pl
Server.Name=$dbsrvr Backup.Database=$cltdb Backup.Type=tran"), Timeout
+ => 600);
$th->waitfor('/sybase?/');
print @lines;
|