Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

by Anonymous Monk
on Oct 12, 2000 at 20:50 UTC ( #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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2020-06-01 19:03 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (9 votes). Check out past polls.