1

I have a build script that uses the standard windows Ftp.exe to transfer big files accross the globe each night. It takes ages!

Filezilla is much much faster, but it doesn't appear to be very scriptable.

Any suggestions?

13 Answers 13

1

You can use NcFtp it can run in windows. It implements a NcFtpPut and NcFtpGet that work great with scripts.

2

Would installing cygwin at your end be an option? Then you should be able to use bash and a (scriptable) unix FTP client from your Windows box.

2
  • Cygwin makes administrating windows systems more tolerable.
    – Joe
    Jul 31, 2009 at 19:08
  • I guess that's at least an option, but my build scripts are convoluted enough as it is! :) I'm still holding out for a windows ftp client which is controllable from the command line. There got to be at least one! Jul 31, 2009 at 19:49
1

Any chance you can use scp instead of ftp? I've used the pscp utiltly in PuTTY and found it to be pretty scriptable. Putty also includes a sftp client, fwiw.

1
  • Yeah, I prefer to use scp/sftp too. But as mentioned, I don't get to chose the transport method here... Jul 31, 2009 at 19:51
1

If full-blown Cygwin isn't an option, you might try the Windows version of cURL.

1
1

WinSCP does both sFTP and FTP.

Scripting is easy & well documented

1

You may also want to try Script2Cloud from K2SXS.

It supports four object-oriented scripting languages (C++, JavaScript, Pascal, Basic) and supports a variety of file transfer protocols including FTP(S), SFTP, WebDAV, and some cloud protocols like Azure and S3 in development.

Here's the web page: http://www.k2sxs.com/script2cloud/

0

at the risk of sounding like a linux zealot, can you switch to rsync? or if you're windows inclined robocopy?

1
  • Not an option. I don't have much control over the protocol (it's going to somebody elses server). Also its FTPing from a Windows machine so rsync is not convenient. Jul 31, 2009 at 18:56
0

I have no experience with it, but ScriptFTP might do the job.

0

you could use powershell:

$File = "C:\foofile.zip"

    $ftp = "ftp://username:[email protected]/upload/incoming/newfile.zip"

    "ftp url: $ftp"

    $webclient = New-Object System.Net.WebClient
    $uri = New-Object System.Uri($ftp)

    "Uploading $File..."

    $webclient.UploadFile($uri, $File)
0

CoreFTP has a scripting module. We've used it to some success. Not great, but plenty OK. I second the cygwin idea. I run cygwin on all my servers (in large part due to my personal dependence on tail).

http://support.microsoft.com/kb/96269 has some notes on scripting FTP in windows.

Wget built for Windows (skpping cygwin.dll) http://pages.interlog.com/~tcharron/wgetwin.html

0

Ditch FTP and use Rsync (DeltaCopy) which copies only the changed files. If DeltaCopy doesn't do what you need -- Cygwin + Rsync + Bash will.

I have also used ActiveState Perl and an FTP library for Perl before to do more complex FTP operations.

0

The basic FTP.exe is quite stable and the first question to ask is,
Why do you get bad performance from that FTP?

You are comparing it with FileZilla performance.
I can think of only two things that could be done to overtake basic FTP performance for large file transfer.

  1. It might be doing a multi-part download to have multiple connections download a file
    • this would help if the server is limiting rate per connection
    • It might be tweaking the TCP Window/buffer size to get a deeper TCP pipe
    • this will help if there is significant round-trip latency to the server

I have not been able to locate a command-line (script-able) client that can be told to perform multi-part downloads. Maybe, if others answering here agree to these ideas, they might be able to suggest a suitable reference.

I have always found NcFTP to be good for most purposes, and was expecting this support to be available there. The so-bufsize control on NcFTP might help with point-2 above.


There is one ActiveState Python script I found in the process,
But, have no idea how to get it usable for your purpose.
reference: threaded multipart FTP download via REST

Odd part is, the discussion on this script says FileZilla was not giving sufficient performance!

We needed to speed up downloading from a client's FTP site. For some reason, we could only get around 21 KB/s when downloading normally (FileZilla). Using this, I was able to get 100 KB/s with 5 connections and 200 KB/s if I was able to open 10 connections.

Currently, this could only download one file at a time. Haven't yet given much thought to downloading multiple file as this, as it is, meets our present requirements.

0

You might want to try wput.

Not the answer you're looking for? Browse other questions tagged .