Solved

FTP download command line

Posted on 2011-02-25
6
329 Views
Last Modified: 2012-05-11
I am trying to download an entire folder from a public FTP server. I can do it manually however i have 2 problems/questions.

the format of the link is >>>> ftp://xx.xx.xx.xx/folderA/subfolderB/subfolderC. xx=public IP address

my first question is that i cannot seem to find a way to download the entire subfolderC without getting prompted to answer a "yes" or "no" n every single file inside. i am using this format once inside
mget *
I have tried the -i switch but i still get the questions on *each* file. This is impossible task when there a literally 200 files inside...how can i accomplish a "yes" autoresponse?

the other question is how can i automate or create a batch file to just paste the link and download the entire subfolderC...

i am planning to create a predefined folder in the C:\ drive in the batch file and also respond to the username and password prompts as well...

please dont respond with hyperlinks unless its really useful. i have searched trust me.

thanks in advance
0
Comment
Question by:lurezero
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 12

Assisted Solution

by:Amick
Amick earned 200 total points
ID: 34985946
Use the command
in the ftp.txt  file (which could be named anything) you will have your session commands, for example:
username
password
hash
bin
mget myPath/*.*
quit

Open in new window


All files matching the spec will transfer without any further interaction required.
0
 
LVL 4

Expert Comment

by:FastSi
ID: 34986164
you can also use the -i option "ftp -i hostname"

-i  Turns off interactive prompting during multiple file transfers.
0
 

Author Comment

by:lurezero
ID: 34986179
well i mentioned i need to create a batch file. i tried creating a batch file with the line you mentioned:
ftp -i -s:ftp.txt ftp.example.com...the result was "invalid command"

how will it know the location of "ftp.txt"
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:FastSi
ID: 34986214
I believe it will need to be in your working directory so if you command line is C:\ the file will need to be in your C:\
0
 
LVL 4

Accepted Solution

by:
FastSi earned 300 total points
ID: 34986251
in your ftp.txt you could have it create the local folder to put the files in also if needed

ftp.txt

username
password
hash
bin
!mkdir NEWFOLDER
lcd NEWFOLDER
mget myPath/*.*
quit

but the command

ftp -i -s:ftp.txt "SERVERS IP OR HOSTNAME

should work, as long as its run from the same directory as the ftp.txt but could also use the full path -s:c:\myfolder\ftp.txt
0
 

Author Closing Comment

by:lurezero
ID: 35131861
ok
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question