Solved

FTP download command line

Posted on 2011-02-25
6
318 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
OfficeMate Freezes on login or does not load after login credentials are input.
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 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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now