Operating System - HP-UX
1845948 Members
2244 Online
110250 Solutions
New Discussion

Script to make automatic ftp

 
SOLVED
Go to solution
Paulo Afonso Bruno
Occasional Advisor

Script to make automatic ftp

Hi all

I?m trying build script ( posix-sh ) to make automatic ftp

I would like put in script the user, passwd and ftp commands

How I make it ???

Thanks a lot

4 REPLIES 4
Alex Glennie
Honored Contributor
Solution

Re: Script to make automatic ftp

1. Create a text file as follows:
open hostname
user username password

bye

2. Run the ftp command as follows:
ftp -i -n
For example, if you want to transfer files from a host called venus to your
system. The files need to be transferred in binary mode and the username for
logging into venus is joeuser with a password of abc123. The files are located
in /data and have an extension of .DB The files will be transferred to /tmp on
your system.


Create a text file called ftp.txt with the following lines:

open venus
user joeuser abc123
binary
mget /data/*.DB /tmp/*.DB
bye

Run the ftp command as follows:

ftp -i -n
federico_3
Honored Contributor

Re: Script to make automatic ftp

try this:

ftp -v -n < ftp_script
###############################
# ftp_script
open
user xxx yyy
prompt off
cd -> Change the remote directory
lcd -> Change the local directory
bin
mget filename
bye
James R. Ferguson
Acclaimed Contributor

Re: Script to make automatic ftp

Hi:

Do a SEARCH in this forum for "FTP". You will be well rewarded. There are many examples and discussions of just the topic you seek. Here are just two threads to start you off:

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

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

...JRF...
Paulo Afonso Bruno
Occasional Advisor

Re: Script to make automatic ftp

Thanks to all for the help