Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can one write script to automate ftp procedures

Status
Not open for further replies.

hmehta

IS-IT--Management
Jun 5, 2002
27
US
How can one write script to automate procedure on ftp prompt. Liek doing cd, lcd and then do get etc ?
 
Or you just need to transfer files -

rsync , rcp , scp comes in mind

ncftp is complete ftp suite so yo dont need any scripts

[evil]
 
where can I get information on ncftp
 
Can I combine ncftp with shell scripts for example, I would like execute a command on the regular shell then go to ftp prompt do some things on the prompt, then come back to regular shell execute some commands and then go back to the ftp prompt again
 
I'd highly recommend reading an "ftp" section from this forum's FAQ - you'be amazed how much you can learn by 'digging around"

vlad
 
I have a script to do this, if you want it please let me know.
 
This will give you some idea:

#!/bin/ksh
FILENAME=urfilname
FTPCOM="open urhost.name.com\nuser usrname usrpass\ncd tourdir\nget "
echo "${FTPCOM} ${FILENAME}\nquit" | ftp -n > /dev/null 2>&1

Where: urfilname = the file you will get
urhost.name.com = the host name or IP address you will ftp to
usrname = the login ID(unix account name)
usrpass = the password
tourdir = the directory where the file you want to get is in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top