I'm basically very new to Perl and I've gone through some of the examples pertaining to secure file copy from a windows based server to an Unix Based server. When using a small file (>10kb) to test the transfer it's successfull, however when the file is bigger (>300kb)the file gets copied partially before truncating and returning an error message. The error message is at the line of scp_put. Below is the script that I'm using.
use warnings; use strict; use Net::SSH2; my $server = "212.100.100.239"; my $datafile = "D:/ETL/RPT/MD/IMSI_SICAP.lst"; #my $datafile1 = "D:\\ETL\\RPT\\MD\\"; my $ssh2 = Net::SSH2->new; die "can't connect" unless $ssh2->connect($server); print "Connected\n"; die "can't authenticate" unless $ssh2->auth(username => 'user',password => 'aaa'); print "Authenticated\n"; my $sftp = $ssh2->sftp; $ssh2->debug(1); my $dir = "/timesten_old/IMSI_SICAP.lst"; $ssh2 ->scp_put("${datafile}","${dir}")or die ("Error"); print "Success\n"; $ssh2->disconnect();
Would really appreciate it if some one could guide me on what I'm doing wrong here. Thanks.
In reply to Unable to transfer file with scp_put using Net::SSH2 by tsandras
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |