Hi Guys,
I have trouble connecting to ftp server. My task is to connect to the proxy server and get the latest file to the local machine. It works fine when i do the same steps manually. I've been trying to do it in multiple ways but im just not able to connect. When i check the log, this is what it says:
Connected to ftpproxy.xx.xxxx.com.
220 <ip address> CSM Proxy Server FTP Proxy ready for login
ftp>
It is not going beyond this.
Below is my script: (we are using
Linux)
#!/bin/sh
$server=ftpproxy
$user=user k123456@xxx.abcdef.com
$password=password
$dir=/abc/xyz/work
$filename=1234.def.ghi.$$
cd $dir (on local machine)
ftp -u $server <<EOF (connecting to the proxy server)
##i tried using -n as well...but it is not working
#the script is not going beyond this point
user $user $password
##i tried giving password in the next line as well, like this:
#user $user
#$password
ls
binary
get $filename
bye
EOF
I too have the .netrc file in the HOME directory but with a different name.
FYI..this is what i do manually:
ftp -u ftpproxy
ftp>
user k123456@xxx.abcdef.com
ftp> <<password>>
ftp> ls
ftp> binary
ftp> get file
ftp> bye
Please help me connecting to the FTP server...because this being the first step in the script..i am not able to execute the other steps as well.
Thanks in advance!!