Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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;

In reply to Net SFTP Foreign rget by SpaansBolletje

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found