How to Upload Files Recursively on Linux Command-Line
Yesterday, I was transferring a blog from one server to another. I had SSH access to the server which the blog was moving from, and FTP access to the one which it was moved to. The simple solution in this situation is to use a command-line FTP client to simply upload everything. I tried, but encountered a problem.
Using the native ftp command, which comes with virtually every Linux distribution, I found the mput (multiple put) command. However, trying to use it with wild-cards didn’t work, since only the files in the base directory were uploaded. Trying things like mput */* only resulted in strange errors about existing files not existing. I went to look for a new text-based FTP client, which would be usable through SSH, and found lftp, which apparently was installed as default on my system.
lftp has a handy mirror command, similar to the wget –mirror option. Adding the -R (reverse) argument to mirror, recursive uploading became a piece of cake. Just do mirror -R when in the correct local and remote directories.

this is the best answer for the “mput *” problem, finally i found the answer in this site. thanks.
“mirror -R” is the best.
i moved from first server (support ssh login) into second server which only support http://ftp.
so “mirror -R” worked very well for my first case,
my question is : “how to move files from one server into another server, in case that both server only support ftp login, not ssh login”. i think this lftp command “mirror” won’t work on my second case. i want to move directly from one server into another one. both servers don’t support ssh login. i don’t want to download to my local computer first. coz it will take longer time.
can you give me the answer?
please also send it to my email hbs_if2@yahoo.com
thanks
Comment by hengky — November 22, 2007 @ 7:58 am
Hi Tim.
This is truly a little gem. I just wish I found out about this one earlier. Thanks for being kind enough to post this this one up. I am sure many people will benefit from this.
Cheers.
Comment by Dave Nicholas — January 28, 2008 @ 8:45 am
Sure, mirror is like mget but can be reccursive.
Is there a way to “mirror” to another server (and not from a server) ?
Thx
Comment by M1N05 — October 7, 2008 @ 12:03 am