develooper Front page | perl.beginners | Postings from April 2011

Net::SCP is saving a file name with a wild card

Thread Next
From:
Dave Thacker
Date:
April 28, 2011 09:31
Subject:
Net::SCP is saving a file name with a wild card
Message ID:
BANLkTin3yxFdM0b4Nyensi4M2mjsY5Cu9A@mail.gmail.com
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


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About