OK, considering that you are using Windows, the most simple way to do that is to use the standard ftp
tool bundled with it. I base the following solution on Windows XP, hoping it'll work as well (or with minor modifications) on other versions.
First of all, you need to create a batch (script) file for the ftp
program, containing instructions for it. Name it as you want, and put into it:
curl -u login:pass ftp.myftpsite.com/iiumlabs* -O
open ftp.myftpsite.com
login
pass
mget *
quit
The first line opens a connection to the ftp server at ftp.myftpsite.com
. The two following lines specify the login, and the password which ftp will ask for (replace login
and pass
with just the login and password, without any keywords). Then, you use mget *
to get all files. Instead of the *
, you can use any wildcard. Finally, you use quit
to close the ftp
program without interactive prompt.
If you needed to enter some directory first, add a cd
command before mget
. It should be pretty straightforward.
Finally, write that file and run ftp
like this:
ftp -i -s:yourscript
where -i
disables interactivity (asking before downloading files), and -s
specifies path to the script you created.
Sadly, file transfer over SSH is not natively supported in Windows. But for that case, you'd probably want to use PuTTy tools anyway. The one of particular interest for this case would be pscp
which is practically the PuTTy counter-part of the openssh scp
command.
The syntax is similar to copy
command, and it supports wildcards:
pscp -batch [email protected]:iiumlabs* .
If you authenticate using a key file, you should pass it using -i path-to-key-file
. If you use password, -pw pass
. It can also reuse sessions saved using PuTTy, using the load -load your-session-name
argument.
curl
? To be honest, it's one of the most hard-to-use tools I've ever seen. What is your platform? Because in the post you mention bash, and in the answer comments you mentioned .bat files... Also, how issftp
relevant? And does your example actually use FTP? Because there's noftp://
there so I'm pretty sure curl used HTTP... – Quincy