Operating System - HP-UX
1828572 Members
2593 Online
109982 Solutions
New Discussion

Re: ftp muntiple files using scripts

 
SOLVED
Go to solution
Thin Lui Cheat
Occasional Contributor

ftp muntiple files using scripts

How do I ftp multiple files to another server using scripts ?

e.g. mput *.txt

Scripts would use the existing userid and password and "force" transfer of all files without prompt.

Thanks a lot
7 REPLIES 7
malay boy
Trusted Contributor

Re: ftp muntiple files using scripts

uhm !!script.I don't have it.But if you use ftp -i it will disable the ftp interactive part.

I try to dig my old stuff and check whether the script is there or not.WIll posted it when have it.

hope this will give some insight.

regards
mB
There are three person in my team-Me ,myself and I.
Steven E. Protter
Exalted Contributor
Solution

Re: ftp muntiple files using scripts

Here is a start, there will be no prompts.

ftp -n <open
user
get ....
mput...
bye
EOF

A few threads that deal with this.

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xe0830559ff7cd4118fef0090279cd0f9,00.html

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x00517e990647d4118fee0090279cd0f9,00.html

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x82dff841489fd4118fef0090279cd0f9,00.html

You really didn't need to wait for an answer, you could have found it with a search.

If the answer was useful, please assign points.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Michael Tully
Honored Contributor

Re: ftp muntiple files using scripts


This script from Mike should help:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2dafa2db8513d6118ff40090279cd0f9,00.html

Regards
Michael
Anyone for a Mutiny ?
malay boy
Trusted Contributor

Re: ftp muntiple files using scripts

well...the master have replied (SEP and Michael).I guest my script no need anymore.

Still learning,
mB
There are three person in my team-Me ,myself and I.
Thin Lui Cheat
Occasional Contributor

Re: ftp muntiple files using scripts

hi guys,

thanks for the fast reply. thats a lot of information here. I managed to test out a script and it works.

cheers
T G Manikandan
Honored Contributor

Re: ftp muntiple files using scripts



ftp -n <open 172.16.1.233
user root
prompt no
cd /tmp/b
mput *.a
bye
EOF
Steven E. Protter
Exalted Contributor

Re: ftp muntiple files using scripts

Just a note.

Of course, all of these methods are quite insecure. The script requires a password to be hard coded into a script.

Worse yet, ftp servers receive/send said password in clear text. The dangers of sending important passwords this way are obvious.

Thanks for the points sir, I would like to make a recommendation.

Secure shell. You can install it, and then exchange public keys, and use the a sftp or scp in a script to do this with secure data exchange and no hardcoded passwords in scripts.

Link to the software, instruction doc attached.


Secure shell
http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com