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?
You can use NcFtp it can run in windows. It implements a NcFtpPut and NcFtpGet that work great with scripts.
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.
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.
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/
at the risk of sounding like a linux zealot, can you switch to rsync? or if you're windows inclined robocopy?
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)
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
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.
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.
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.