Click here to Skip to main content
11,790,613 members (63,889 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Linux Shell script
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 at 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 at 25-Sep-12 5:14am
thank you!i'll figure it out..
manoranjan at 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 at 25-Sep-12 5:15am
okay..thank you..i'll check my TCP and firewall..
manoranjan at 25-Sep-12 5:21am
Have you set REMOTE to correct IP (or hostname) and not ''?
aianne at 25-Sep-12 5:24am
yeah..i set my remote correctly..i just put zeros for this post only..
aianne at 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
0 OriginalGriff 1,114
1 Maciej Los 825
2 KrunalRohit 686
3 CPallini 611
4 ppolymorphe 610

Advertise | Privacy | Mobile
Web02 | 2.8.1509028.1 | Last Updated 25 Sep 2012
Copyright © CodeProject, 1999-2015
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