SpaansBolletje has asked for the wisdom of the Perl Monks concerning the following question:
I am using SFTP Foreign, for a script that I am making (Collect logging data from yesterday using a sFTP connection).
Since the package is new to me, I like to work in blocks, get the basic function working and then add more options. So first up was getting the log data and not worry about the date yet.
As the documentation says is that I need to use the rget (recursive get). I thought this would copy the folders inside the folder including the data.
What it does now, it copies only the directory names (in correct structure). So where did my files go?
As this is a offline machine, I am still looking how to get the debug prompt back to a usb stick.
I just read the debug log, and it notifies that the " remote files " are not regular files, directory or link. What does this mean? As it mostly is just log files in .log etc..
$host = 10.0.0.1; # Random ip for example $user = user; $pass = pass; $logcopy = /temp/sftp/01; $logpaste = copy01; ## Open connection my $sftp = Net::SFTP::Foreign->new($host, user => $user, password => $ +pass) or print "\nCould not open connection \n" . $sftp->error; ## Recursive get files $sftp->rget($logcopy, $logpaste) or print "Failed retrieving file. \n" + . $sftp->error;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net SFTP Foreign rget
by salva (Canon) on Nov 27, 2013 at 09:04 UTC | |
by SpaansBolletje (Initiate) on Nov 27, 2013 at 09:11 UTC | |
by salva (Canon) on Nov 27, 2013 at 09:25 UTC | |
by SpaansBolletje (Initiate) on Nov 27, 2013 at 09:28 UTC | |
by SpaansBolletje (Initiate) on Nov 27, 2013 at 17:39 UTC | |
by salva (Canon) on Nov 27, 2013 at 17:56 UTC |