Wrote a sftp script and when I run it thru a webbrowser I get this error message.
Software error:
Permission denied at /usr/lib/perl5/site_perl/5.6.1/Net/SFTP.pm line 37
Here is my script.
#######################################
$args{'debug'} = 0; $args{'user'} = "auser"; $args{'password'} = "apassword";
$sftp = Net::SFTP->new($ftp_info[0], %args)
or die "Cannot connect to $ftp_info[0]: $@";
foreach $i (@table) {
$twv = "$i\_$dump_version";
if (-d "$file_path/$twv\_$mathdate$mathtime.txt") {
$sftp->put("$file_path/$twv\_$mathdate$mathtime.txt", "$twv\_$mathdate$mathtime.txt")
or die "put $file_path/$twv\_$mathdate$mathtime.txt failed ", $sftp->message;
}
}
if (-d "$file_path/totals\_$mathdate$mathtime.txt") {
$sftp->put("$file_path/totals\_$mathdate$mathtime.txt", "totals\_$mathdate$mathtime.txt")
or die "put $file_path/totals\_$mathdate$mathtime.txt failed ", $sftp->message;
}
$sftp->quit;
#######################################################
Any help on this would be greatly appreciated.
Chris Burger
Software error:
Permission denied at /usr/lib/perl5/site_perl/5.6.1/Net/SFTP.pm line 37
Here is my script.
#######################################
$args{'debug'} = 0; $args{'user'} = "auser"; $args{'password'} = "apassword";
$sftp = Net::SFTP->new($ftp_info[0], %args)
or die "Cannot connect to $ftp_info[0]: $@";
foreach $i (@table) {
$twv = "$i\_$dump_version";
if (-d "$file_path/$twv\_$mathdate$mathtime.txt") {
$sftp->put("$file_path/$twv\_$mathdate$mathtime.txt", "$twv\_$mathdate$mathtime.txt")
or die "put $file_path/$twv\_$mathdate$mathtime.txt failed ", $sftp->message;
}
}
if (-d "$file_path/totals\_$mathdate$mathtime.txt") {
$sftp->put("$file_path/totals\_$mathdate$mathtime.txt", "totals\_$mathdate$mathtime.txt")
or die "put $file_path/totals\_$mathdate$mathtime.txt failed ", $sftp->message;
}
$sftp->quit;
#######################################################
Any help on this would be greatly appreciated.
Chris Burger