Solved

FTP download command line

Posted on 2011-02-25
6
323 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
  • 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now