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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP scripts

Status
Not open for further replies.
Mar 19, 2002
1
US
Hi,

I need to transfer some .log files from my /export directory to a public share on other server. I can ftp the files but I need to automate this process and I would like to know if I can create an script to automate it and how to make it work??


Thanks,
Erick
 
Here's a template.

# ftp server/login info
FTP_HOST='hostname'
FTP_USER='ftp_user'
FTP_PASSWD='ftp_pass'

# local directory
LOCAL_DIR=/tmp

# remote directory
REMOTE_DIR=/tmp

# file
XMT_FILE=filename

# connect via ftp
ftp -n $FTP_HOST<<END_SCRIPT
quote USER $FTP_USER
quote PASS $FTP_PASSWD
cd $REMOTE_DIR
put $XMIT_FILE
quit
END_SCRIPT
Robert G. Jordan

Robert@JORDAN2000.com
Unix Sys Admin
Chicago, Illinois U.S.A.
[lightsaber]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top