Operating System - HP-UX
1757032 Members
2449 Online
108858 Solutions
New Discussion юеВ

ftp automated script from HP-UX 11.11 64 bit to outside server

 
SOLVED
Go to solution
Bonnie Temple
Advisor

ftp automated script from HP-UX 11.11 64 bit to outside server

I can run these commands individually at HP-UX 11.11 command line and can ftp files to the outside vendor's server no problem. But when I put them in this script -because I want cron to end up running it regularly- it stops at "220 Welcome to Vendor's FTP server (2)"
and remains at the ftp> prompt.
Thanks.
I created a file with perms 777 owner: root group:sys
Here is the content of the file:

cd /
ftp -n -i -v 146.111.111.8
user me mypassword
cd /
lcd /
mput bo*
bye
!
2 REPLIES 2
Patrick Wallek
Honored Contributor
Solution

Re: ftp automated script from HP-UX 11.11 64 bit to outside server

You need to use what is called a "here document". Modify your script so it looks like this:

cd /
ftp -n -i -v 146.111.111.8 << EOF
user me mypassword
cd /
lcd /
mput bo*
bye
!
EOF
Bonnie Temple
Advisor

Re: ftp automated script from HP-UX 11.11 64 bit to outside server

Thank you. That works great!