Solved

FTP download command line

Posted on 2011-02-25
6
331 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

688 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