Hi
I have finally written the following script which handles the scp successfully, but I cannot get it to print msgs, I need to add some error handling routines, and responses, like if connected and file transferred it should print this msg or else print the error mesgs - thanks for your help
Brenda
------[Script]-------
#/usr/local/bin/perl -w
use lib '/opt/pg/pgperl/lib/site_perl/5.6.1/';
use Net::SCP::Expect;
open STDERR, ">>script.log" or die $!;
$scpe = Net::SCP::Expect->new(host=>'solarisbox',user=>'solaris',password=>'solaris',auto_yes=>1,timeout_auto,verbose=>1);
$scpe->scp('script.txt','/opt/logs/scripts/');
if ($scpe == NULL) {
print STDERR "Could not connect to the host\n";
exit(9);
}else{
print STDERR "SCP to target was successful\n";
}
close STDERR;
exit;
------[Script]-------
I have finally written the following script which handles the scp successfully, but I cannot get it to print msgs, I need to add some error handling routines, and responses, like if connected and file transferred it should print this msg or else print the error mesgs - thanks for your help
Brenda
------[Script]-------
#/usr/local/bin/perl -w
use lib '/opt/pg/pgperl/lib/site_perl/5.6.1/';
use Net::SCP::Expect;
open STDERR, ">>script.log" or die $!;
$scpe = Net::SCP::Expect->new(host=>'solarisbox',user=>'solaris',password=>'solaris',auto_yes=>1,timeout_auto,verbose=>1);
$scpe->scp('script.txt','/opt/logs/scripts/');
if ($scpe == NULL) {
print STDERR "Could not connect to the host\n";
exit(9);
}else{
print STDERR "SCP to target was successful\n";
}
close STDERR;
exit;
------[Script]-------