HP ARPA File Transfer Protocol User's Guide (36957-90159)
44 Chapter4
Using FTP
Using FTP Commands in UDCs and Programs
Transferring Multiple Files
You can create a command file to automatically copy a group of files from the remote
system into your account as in the following example.
1. Create a file with the following contents:
2. From the CI, (:) enter the following to execute the command file you created:
:yourfile remotehostname username password
EXITONERROR is enabled in the above example. If there is an error while executing, the
error will be printed on the terminal display.
You can create a UDC using the same set of commands above, except changing the word
parm to a UDC name such as getfiles. The first statement for this UDC is:
getfiles node, user, pass
Enter the contents of the file in your UDC file. To execute this UDC, you would enter:
:getfiles
remotehosthame username password
Using a Jobstream
The following example shows how to use a job file to automate the logon procedure and
retrieve a file from a remote system. To execute a job, enter STREAM
jobname
at the MPE/iX
prompt (:).
!JOB FTPFILE,USERNAME.ACCT,PUB
!RUN FTP.ARPA.SYS
OPEN 123.50.42.32
USER remuser rempass
PWD
DIR*
GET file1
QUIT
parm node, user, pass
continue
purge ftpcmds,temp
echo exitonerror
echo open !node
echo open !user !pass
echo get file1 file1
echo get file2 file2
echo get file3 file3
echo quit
> > ftpcmds
> > ftpcmds
> > ftpcmds
> > ftpcmds
> > ftpcmds
> > ftpcmds
> > ftpcmds
run ftp.arpa.sys;stdin=ftpcmds
if !FTPLASTERR < > 0 then
showvar FTP@
endif
continue
purge ftpcmds,temp