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.
In reply to Problem with Net::SCP::Expect by xorl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |