xorl has asked for the wisdom of the Perl Monks concerning the following question:
It dies with the error:#!/usr/bin/perl use strict; use Net::SCP::Expect; my $user = "xferusr"; my $password = "xxxxxxxx"; my $server = "server123.internal"; my $remotedir = "/var/www/html/reports/2009"; my $filelocation = "/opt/work/reports/2009/"; print "Login...Starting scp..."; my $scpe = Net::SCP::Expect->new(host=>$server, user=>$user, password= +>$password, recursive=>'1'); print "\nFILELOCATION:" . $filelocation . "*\n"; print "REMOTEDIR: " . $remotedir . "\n"; $scpe->scp($filelocation . '*', $remotedir); print "SCP complete\n";
Error: last line returned was: opt/work/reports/2009/*: No such file or director at /usr/lib/perl5/site_perl/5.8.0/Expect.pm line 760If I set verbose I get:
Executing: program /usr/bin/ssh host server123.internal, user ftpusr, command scp -v -r -t /var/www/html/stats_intra/2008 OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f xferusr@server123.internal's scp exited with non-success state: 256 at ./test_scp.pl line 19If from the command line I do:
It works just wonderfully. So I'm guessing I'm doing something wrong with Perl.scp /opt/work/reports/2009/* xferusr@server123.internal:/var/www/html/ +reports/2009
It appears from that first error message that the "/" at the beginning of the path was stripped off. I'm not sure why or how to fix that, or if this is just some weirdness with the error messages.
Can anyone help me figure this out?
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with Net::SCP::Expect
by salva (Canon) on Feb 23, 2009 at 15:22 UTC | |
by xorl (Deacon) on Feb 23, 2009 at 15:54 UTC | |
by salva (Canon) on Feb 23, 2009 at 16:55 UTC | |
by xorl (Deacon) on Feb 25, 2009 at 16:03 UTC | |
|
Re: Problem with Net::SCP::Expect
by zentara (Cardinal) on Feb 23, 2009 at 16:04 UTC | |
|
Re: Problem with Net::SCP::Expect
by Illuminatus (Curate) on Feb 23, 2009 at 16:58 UTC | |
|
Re: Problem with Net::SCP::Expect
by Anonymous Monk on Jun 03, 2015 at 11:02 UTC |