tsandras has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to transfer file with scp_put using Net::SSH2
by syphilis (Archbishop) on Aug 02, 2010 at 09:11 UTC | |
by salva (Canon) on Aug 02, 2010 at 10:19 UTC | |
by tsandras (Initiate) on Aug 06, 2010 at 07:01 UTC | |
by syphilis (Archbishop) on Aug 23, 2010 at 21:33 UTC | |
by tsandras (Initiate) on Mar 01, 2011 at 08:46 UTC | |
|
Re: Unable to transfer file with scp_put using Net::SSH2
by Khen1950fx (Canon) on Aug 02, 2010 at 07:59 UTC | |
by tsandras (Initiate) on Aug 06, 2010 at 06:42 UTC |