FTP (File Transfer)

I am going to transfer file from UNIX directory to remote windows location and i wrote the script but i am getting the error as 'FTP: not found' or i am getting this error 'The file path is not found'.

Please help me to resolve this problem as early as possible.(urgent).

my script is,

LOCAL_PATH='/apps/dw.....'
HOST='AGCY'
USER='..'
PWD='...'
PATH='\TestAGCY'
cd $LOCAL_PATH
ftp -n $HOST << END_SCRIPT
quote USER $USER
quote PASS $PWD
cd $PATH
prompt off
mput Extract_File.out
exit
END_SCRIPT

This may help you...

http://www.unix.com/shell-programming-scripting/105346-use-ftp-shell-script.html

Please also do search in forum...you may get lot more results..

Thanks
SHa

Is there any method without passing user name & password directly in FTP command.

Dear Praka,

FTP without user name / password can be done by ssh configuration. First you need to make ssh connection between two servers, then you able to do SFTP without password.
Command : sftp username@server_ip

For simple file transfer without user name / password use scp.

Regards,
Prakhar

Is there any other way to capture the server name,user name and password in some other file and referring the file in UNIX Script.:b:

Use this script & test:

>cat ftp_main
10.10.10.10|uname|passwd

>cat do_ftp.sh
HOST=`awk -F"|" 'printf{$3}' ftp_main`
USER=`awk -F"|" 'printf{$2}' ftp_main`
PWD=`awk -F"|" 'printf{$1}' ftp_main`
LOCAL_PATH='...'
PATH='...'
cd $LOCAL_PATH
ftp -n $HOST << END_SCRIPT
user $USER $PWD
cd $PATH
prompt off
mput Extract_File.out
bye
END_SCRIPT

> ./do_ftp.sh

FTP has a facility to read login and password from a file called ".netrc".
man .netrc .

Permissions on such a file should be 600 and owned by the user or (preferably) root. Most FTP implementations will ignore a .netrc file which has the wrong permissions.

However, use Secure FTP if you can.