![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copying files from a remote server to local system with cygwin | patwa | UNIX for Dummies Questions & Answers | 3 | 06-12-2008 04:49 AM |
| Automatically copying files from server to local drive? | Sepia | UNIX for Dummies Questions & Answers | 1 | 06-05-2008 09:24 PM |
| Copying specific folders from one server to another | chris1234 | Shell Programming and Scripting | 4 | 12-18-2007 03:44 PM |
| delete all folders/files and keep only the last 10 in a folder | melanie_pfefer | Shell Programming and Scripting | 3 | 11-17-2006 11:33 AM |
| Copying Folders without some folders... ;-) | chimpu | UNIX for Dummies Questions & Answers | 5 | 04-26-2004 09:25 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Copying multiple folders to local machine (don't know folder names)
Hi.
I'm trying to copy multiple folders from the remote machine to the local machine. I wrote a batch file to run an ftp window. The problem I am having is that the only command to copy files is mget *, and this copies only files, not folders. For example, ftp ts555 cd ts555/test ' test has an unspecified number of folders, anywhere from 1 - 6 I cannot type mget * because it will not systematically go into each folder and get the files, it will just give me an error. I do not know the names of the folders in ts555 because they change daily. I somehow need to access all the files in all the folders in ts555 Thank you! |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
The bad news is there is no way to do it with ftp in a simple or straightforward way. ftp was designed as an interactive program and hence is simply not built with your purpose in mind. It may be possible - with finite, but probably pretty high amount of work to put in - to script a solution around ftp, but i wouldn't suggest doing that. What you can do, though, is to use r-commands (rcp) or their securized counterparts (scp, ...). Look at the manpages of rcp and/or scp and decide for yourself if they fit your purpose. Another way is to create a tar-file of the subtree and use ftp to transfer it from one machine to another, then use tar to extract it there. While this is a simple and straightforward solution it needs some (depending on the amount of data you want to transfer) and maybe even a lot of disk space. Roughly the size of the tar archive is as big as the single files summed up (check with du to get a picture, if you want to transfer one subtree /transfer/this then issue du -ks /transfer/this to get the number of kbytes. The same number you will need again for the tar archive. bakunin |