Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to FTP the contents of a directory, but can't seem to find the right way to use a wildcard. Seems like this would be a common thing to do, is my whole approach wrong?

The command is

ftp -s:"C:\Scripts\ftp01" ftpserver.domain.com

The script that is called is below. Updated per billinkc.

username
password
ascii
cd "/destinationfolder"
lcd "C:\Backup"
mput *.bak
close
quit

The script starts, no files are copied and the ftp session remains open.

230 User username Logged in Successfully
ftp> ascii
200 TYPE Command OK A
ftp> cd "/destinationfolder"
250 Directory successfully changed to "/destinationfolder"
ftp> lcd "C:\Backup"
Local directory now C:\Backup.
ftp> mput *.bak
mput 9829980.bak? close
mput 6406766.bak? quit
ftp>
ftp>

Conclusion Needed to add the flag to suppress the PROMPT command.

ftp -i -s:"C:\Scripts\ftp01" ftpserver.domain.com
share|improve this question

migrated from serverfault.com Nov 16 '11 at 14:57

This question came from our site for professional system and network administrators.

6 Answers 6

up vote 13 down vote accepted

Before issuing the mput command, issue a prompt command to disable Interactive Mode. Once that's off it shouldn't ask you to confirm each file for the mput (or an mget).

share|improve this answer

As Tim Haegele mentioned, ncftp does this very smoothly on linux, if you are able and willing to install it.

sudo apt-get install ncftp
ncftp -R ftpserver.domain.com . /Scripts/ftp01
share|improve this answer

if you have admin rights you can install ncftpput. It is easy to use and great for recursive ftp uploads. The switch for recursive transfer is -R.

http://www.ncftp.com/ncftp/doc/ncftpput.html

The software is included in the most linux distribution. For windows it is installable with cygwin http://cygwin.org

share|improve this answer

Try inserting the line prompt n just before the mput line

share|improve this answer

I've never tried using the pathname for local folders but I have done it by changing the local directory (lcd)

username
password
ascii
cd "/destinationfolder"
lcd Backup
mput *.bak
close
quit
share|improve this answer

use the mput command to put multiple files.

share|improve this answer
    
Yes, that's what I am using –  mmcglynn Nov 16 '11 at 14:58
    
Behind a firewall (particularly SOHO or cheap business grade units)? The built in ftp in Windows doesn't support PASV mode, so the transfer will hang and never complete. –  Chris S Nov 16 '11 at 15:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.