[HPADM] FTP Script

From: Roger Realsen (roger.realsen@wareforce.com)
Date: Wed Mar 12 2003 - 19:12:43 EST


Gurus

HP9000 D250
HPUX11.0

I currently use the following script to ftp files:

================================
#!/bin/sh
#
# ftpsend.sh - transmit a file via ftp

{
# build the ftp command script

echo "verbose" # for debugging and logging purposes
echo "open $1" # open the connection to remote site
echo "user" $2 $3 # supply the userid and password
echo "lcd" $4 # change local directory
echo "cd" $5 # change directory up one level
echo "$6 $7" # put or get the file
echo "close" # close the ftp connection
echo "bye" # terminate ftp
} | ftp -n >> /usr/tmp/ftpsendlog.$$
#
# end of ftpsend.sh
================================

When I run the script I pass in the appropriate parameters. For example:

Server: server1
UserID: user
Password: pwd
Local Directory: /usr/tmp
Remote Directory: /files
Filename: file1

To PUT the file:
# ./ftpsend.sh server1 user pwd /usr/tmp /files put file1.

How would I modify this to utilize any number of FTP commands (instead of
just put or get)?

Any help is appreciated.

Sincerely,

Roger Realsen
Director of IT
WF Acquisition Sub, Inc.
19 Morgan
Irvine, CA 92618
PH: (949) 472-9000
FX: (949) 452-1413
Email: roger.realsen@wareforce.com

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:27 EDT