The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: FTP thru script
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-25-2007
jimmyc jimmyc is offline
Registered User
  
 

Join Date: Dec 2006
Location: dallas tx
Posts: 43
Here is a script that I use sometimes. You can comment/remove some of the options such as the log or debug...

cat goftp2

#!/bin/sh
#set -v
echo NOTE: check ftplog for connection info
DATE=`date`
echo Current time is $DATE
rm ftplog
date >>ftplog

HOST='192.168.0.01 5021'
USER='user01'
PASSWD='user01'
#FILE='/home/user01/file.txt'

ftp -v -n $HOST >>/home/user01/ftplog 2>&1 <<EOJ
quote USER $USER
quote PASS $PASSWD
debug
pwd
passive
mput aaa*
ls
close
bye
DATE=`date`
echo Current time is $DATE
EOJ
exit 0