Operating System - HP-UX
1827876 Members
1466 Online
109969 Solutions
New Discussion

Re: ftp using a unix script

 
SOLVED
Go to solution
Anthony khan
Frequent Advisor

ftp using a unix script

I am trying to ftp from inside of a unix script from one unix box to another. I use the following syntax

ftp -inv <
7 REPLIES 7
Sridhar Bhaskarla
Honored Contributor

Re: ftp using a unix script

Hi Anwar,

Try some word instead of !. Like

ftp -inv << EOF
open system
user login password
bin
mget *
quit

EOF

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Uday_S_Ankolekar
Honored Contributor

Re: ftp using a unix script


Hi,


ftp -n hostname
user user_name user_password
bin "or" ascii
cd /to the directory
get file_name1
get file_name2

-USA..

.
Good Luck..
someone_4
Honored Contributor

Re: ftp using a unix script

Here is what i use

ftp -n << EOF
open host
user username passwd
prompt
cd /dir/where/you/want/file
lcd /dir/on/local/cleint #optional
mput *
bye
EOF
Uday_S_Ankolekar
Honored Contributor

Re: ftp using a unix script


Oops..

First should be like this (

ftp -n hostname <<-ftpover

End line
ftpover
Good Luck..
Sanjay_6
Honored Contributor
Solution

Re: ftp using a unix script

Hi Anwar,

Try this,

ftp -n Server_name <user login password
bin

mget *
bye
EndFTP

Hope this helps.

Regds
Mike Hassell
Respected Contributor

Re: ftp using a unix script

anwar,

Please see the attached shell script that I use for this purpose. It uses the same syntax as the others have mentioned above, however it's easily implemented and can be called from other scripts. It also includes some error checking to ensure the file was sent correctly. Hope that helps.

-Mike
The network is the computer, yeah I stole it from Sun, so what?
Anthony khan
Frequent Advisor

Re: ftp using a unix script

Thanks all of you for quick reponse, following snytax work
ftp -inv Servername <user loginname passwd
bin
mget *
bye
EndFTP

Once again thanks all of you.