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!

FTP in SUN using Solaris 8

Status
Not open for further replies.

2a

IS-IT--Management
May 30, 2001
40
US
I have a file that I need to ftp to a novell directory on a Sun server. There is a script that I wrote to generate this file truncate it then concatenate, then rename the file. I will like the output to be ftp to a Novell server login in to a ftp server first before login a file server on Novell. Is anyone out there know how I can ftp this file to novell server automatically every night or as needed.

Please help.

Example looks like this.
# !/bin/sh
ftp 10.1.1.1 //login name/password/ cd //server/12/123/
put file..
close
bye
exit

I just would like to know how I can accomplish this

Thanks
 
if security is not a issue I think you can use a very simple shell script, like this:

#!/bin/sh
#ftp.sh

HOST=$1
USER=$2
PASSWORD=$3
MODE=binary
CD="/server/12/123"
COMMAND="put file"

LOG_IN="open $HOST\nuser $USER $PASSWORD\n"

echo "${LOG_IN}${MODE}\ncd ${CD}\n${COMMAND}" | ftp -v -n
#

# ftp.sh 10.1.1.1 myuser mypass

... change commands acording your needs and add some error check...

Hope this helps,

Regards,

Carlos Almeida

 
You can also build a parameter file (ex: ftp.in) that will look like this :

user username passwd
put file_name
quit

where username = login user and its passwd

you will then call ftp using the following syntax :

ftp destination_name < ftp.in
 
Thank you guys..I am going to try this. I will let you all know what is the end result. But it looks like it's going to get the job done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top