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 > Shell Programming and Scripting
.
google unix.com




Thread: FTP Problem
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-06-2008
kdyzsa kdyzsa is offline
Registered User
  
 

Join Date: May 2008
Posts: 14
FTP Problem

Hi, I'm currently stuck in this ftp problem. Normally I just type ftp at the command line, but now I have to implement it in a code.

Basically I have to transfer a .txt file from a server, let's say hkhpdv13 in the folder of /home/sap/ftp to another server hkhpdv15 in the folder /home/sap/ftp/text

I've researched and saw this sample code.

#!/bin/sh
HOST='ftp.users.qwest.net'
USER='yourid'
PASSWD='yourpw'
FILE='file.txt'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0

I don't really know where they get the END_SCRIPT, and also how they transferred to another server there. Help in explaining please?

I want to know how to transfer a file if it switches from one server to another. As well as how do I know if the file transfer was successful or not, is there a code in there? or something any help would be appreciated.