Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp mget question

Status
Not open for further replies.

DoraC

Programmer
May 7, 2002
98
US
Hi,

I tried to stack ftp mget commands within a script, but have found that it doesn't work... For example,

Code:
    mget test1*
    mget test2*

only retrieves test1* files, even though there are test2* files present. Is something syntactically wrong with this approach, or should I raher be doing

Code:
    mget test1* test2*

Thanks,
dora
 
Hi Dora,

please try the following script. But I have to sa that "ftp" is a very unsecure service (the password will not be encrypted over the network); can't you use the ssh protocol for transferring your data?

A few explanations:
ftp -n: does not attempt auto-login
prompt: interactive mode off
ascii: sets "representation type" to ASCII (I think this is the default anyway)

#!/bin/ksh

ftp -n << END

open remoteservername
user username password
prompt
ascii
mget test1*
mget test2*
bye

END

exit 0

I hope this is helpful.

mrjazz [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top