Quote:
Originally Posted by
ali560045
i did it like this but it getting stuck
FTPSERVER="100.48.143.13"
FTPLOGIN="nali"
FTPPASS="sun1123"
FTPDIR="class"
FILE="file1.txt"
ftp -n -i $FTPSERVER <<EOF
user $FTPLOGIN $FTPPASS
cd $FTPDIR
put $FILE
quit
EOF
--------------------------------------------------------------------------
what to do
################# FTP #############################
USER_LOG='/u01/UAT/scripts/scriptslog/in_ftp_pushing.log'
`touch $USER_LOG`
REMOTESERVER=97.253.17.142 # Your Remote IP
REMOTEPATH='/u01/app/ITOPS' # Give the Full path
LOGIN='it_dwh' # Your Login Name
PASSWORD='it_dwh' # Your Login Pwd
cd $LOCALDIR
ftp -n $REMOTESERVER << INPUT_END
quote USER $LOGIN
quote PASS $PASSWORD
hash
bin
cd $REMOTEPATH
prompt off
mput *.osa.gz # Add your file1.txt
bye
INPUT_END
if [ $? -ne 0 ]
then
echo "Error in the FTP file moving. on `date` " >> $USER_LOG
echo "The OUT_STATUS is: $?" >> $USER_LOG
else
echo "The FTP file is moved successfully.." >> $USER_LOG
echo "The OUT_STATUS is: $?" >> $USER_LOG
fi
################################################
Regards
Mr.Hanuma