Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone!i need help..i don't know how to fix errors in my script..i need to get and put data in other machine using ftp..please help me..thanks!


#!/bin/ksh

REMOTE='000.000.0.000'
USER='xxx'
PASSWORD='xxx'

source_dir='cd /usr/src'
target_dir='cd /usr/src'

ftp -n $REMOTE <<_FTP
quote USER $USER
quote PASS $PASSWORD

bin
lcd $source_dirpeed
cd $target_dir

put sample.txt
bye
_FTP
exit



error:

ftp: connect: Connection refused
Not connected.
Not connected.
Not connected.
Local directory now /root
Not connected.
Not connected.
Posted
Comments
Richard MacCutchan 25-Sep-12 4:52am    
The first message you receive tells you that the server refused to accept an ftp connection request. You need to find out why.
aianne 25-Sep-12 5:14am    
thank you!i'll figure it out..
manoranjan 25-Sep-12 5:10am    
Usually, 'connection refused' error occurs if the server is not running. It can also occur if a firewall is blocking the connection. (but this is rare since f/w is usually configured to drop a packet). Check also whether TCP filter on network adaptor is enabled.
aianne 25-Sep-12 5:15am    
okay..thank you..i'll check my TCP and firewall..
manoranjan 25-Sep-12 5:21am    
Have you set REMOTE to correct IP (or hostname) and not '000.000.0.000'?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900