Dave, in looking at the documentation for Net::SCP, it does not appear that
it can accept a wildcard.  It looks like it has to be the exact name of the
file that you wish to retrieve.  It might be creating a file with nothing in
it.  When it retrieves that file, is it really the file, or just a zero byte
file?

Tim


-----Original Message-----
From: Dave Thacker [mailto:dthack...@gmail.com] 
Sent: Thursday, April 28, 2011 12:31 PM
To: beginners@perl.org
Subject: Net::SCP is saving a file name with a wild card

Hi,
I need to pull a file or files down every day that contain a specific
string.   Here's my code.


#!/usr/bin/perl
use strict;
use Net::SCP;

my $scp=' ';
open (LOG, ">>/home/wesaysopost/logs/retrieve-wesayso-results.log") or die
"Can't open logfile";
LOG-> autoflush(1);

print LOG "Starting Retrieval Process";
$scp = Net::SCP->new ( "theserver.wesayso.com", "mylogin");
$scp->cwd("postingscript")  or die "Can't change directories";
$scp->get ("acme_posting*") or die "Can't retrieve results";
close LOG;
exit;

The file I'm retrieving is acme_posting20110415.txt   (date changes every
day)

The file is found, but it's being saved as acme_posting*

I'm not specifying a local file name when I get the file, why is SCP saving
it under a different name?

Thanks in Advance!

Dave


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to