Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error with NET::SFTP

Status
Not open for further replies.

cb49747

MIS
Joined
Apr 23, 2002
Messages
181
Location
US
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
 
What does your error log say?

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top