1843944 Members
2421 Online
110226 Solutions
New Discussion

Re: FTP automate script.

 
Vishal Ranjan
Occasional Advisor

FTP automate script.

Hi,

I want to automate FTP process & for that i want to write an UNIX script.
I want to send some files from hostserver (say) to ftp.host.com (say), the files are located in hostserver's
/interfaces/sid/send (say) directory.
I want to ftp with user ftpuser(say) & password dummypass (say).
Can anybody help?

Regards,
Vishal
3 REPLIES 3
Senthil Prabu.S_1
Trusted Contributor

Re: FTP automate script.

Hi,
This is a very simple step to automate FTP...but need to be further enhanced.

ftp -v -n $host.com < user "username" "password"
bin
prompt
put
quit
EOF

HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Jason Ray
Frequent Advisor

Re: FTP automate script.

Hey Vishal,

You could do something like this.

cd /interfaces/sid/send
ftp -nv ftp.host.com << EOF
user ftpuser dummypass
put thefile
bye
EOF

or if you want to put all of the files, after the "user" line use:
prompt
mput *
bye
EOF

Hope that helps.
Arturo Galbiati
Esteemed Contributor

Re: FTP automate script.

Hi Vishal,
you can get two very good Perl script ftpget.pl and ftpput.pl which perform what you need in a controlled way checking the errors as well.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1126288

HTH,
ARt