Solved

FTP download command line

Posted on 2011-02-25
6
325 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

773 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