Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Using Net::FTP to download log files...

by Anonymous Monk
on Oct 12, 2000 at 20:50 UTC ( [id://36436]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am using Net::FTP to download log files from about 50 domains but it seems to take much longer than it would if I were to use ws_ftp or the like. A lot of times it never seems to finish at all. Is there a way to improve the speed and reliability of Net::FTP, or would another module be more suited for this task?
  • Comment on Using Net::FTP to download log files...

Replies are listed 'Best First'.
Re: Using Net::FTP to download log files...
by Fastolfe (Vicar) on Oct 12, 2000 at 21:19 UTC
    Net::FTP should not be any slower than any other FTP client. I would try to diagnose this as a problem. Attempt to FTP out from the same machine. If you continue to get slow connections, perhaps it's the connection for this machine. If you're getting through fine, try turning on some of Net::FTP's debugging options and see if you can diagnose the problem. It's designed to be a simple and efficient FTP mechanism for Perl. I would expect it to be faster than any GUI FTP client.
Re: Using Net::FTP to download log files...
by gbarr (Monk) on Jan 18, 2002 at 01:22 UTC
    One thing that causes the most slow down in Net::FTP is transferring in ASCII mode. In ASCII mode the file is transmitted over the net with lines ending in CRLF.

    This means that Net::FTP, and the server, have to do some processing to add and remove the CR if the native text file format of the machine is to just have LF (i.e. UNIX machines).

    So, if you know that the line endings in the file on the server are in the correct format for the client, then transfer in binary mode and you will see quite a speedup.

    Another option that can speed things up is to use a larger blocksize for the transfer.

Re: Using Net::FTP to download log files...
by Anonymous Monk on Jan 15, 2002 at 21:12 UTC
    We can use the system ftp command as follows:
    system "ftp -invs:sample.par";
    where 'sample.par' is an ftp script file containing:
    o hostname user login password cd destination_home_dir_name lcd local_directory_name binary or Ascii ....required ftp commands like get,put etc...... bye
    the parameters are:
    i = prompt off i.e. non-interactive s = silent i.e. suppress the output
Re: Using NET::FTP to download log files...
by Anonymous Monk on Mar 23, 2002 at 08:16 UTC
    My file size is big 253733509 bytes. It craps out in the middle of teh transfer... any particular way i can get it to work?

    Originally posted as a Categorized Answer.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://36436]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-20 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found