Click here to Skip to main content
13,086,662 members (56,311 online)
Rate this:
Please Sign up or sign in to vote.
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!



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

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

lcd $source_dirpeed
cd $target_dir

put sample.txt


ftp: connect: Connection refused
Not connected.
Not connected.
Not connected.
Local directory now /root
Not connected.
Not connected.
Posted 24-Sep-12 19:32pm
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 ''?
aianne 25-Sep-12 5:24am
yeah..i set my remote correctly..i just put zeros for this post only..
aianne 26-Sep-12 4:28am
is it right that the variable in remote is the ipaddress of the machine that im going to connect?and the lcd is my own directory while the cd is the directory of the other machine?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 25 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100