The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Operating Systems
> Linux Help
|
Ftp connection using korn script
Discuss Ftp connection using korn script in the Linux Help forum on Dev Shed. Ftp connection using korn script Linux Help forum discussing topics including usage, troubleshooting, modules, and distributions. Linux is an open source OS, based on UNIX.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

September 23rd, 2012, 10:15 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 6
Time spent in forums: 1 h 52 m 24 sec
Reputation Power: 0
|
|
|
Ftp connection using korn script
hi everyone!please help me..i need a korn shell script that can get and put data in a server using ftp..thanks!
|

September 24th, 2012, 09:23 AM
|
|
|
|
Do you know what the file names are that you will be ftp-ing?
__________________
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
|

September 24th, 2012, 08:11 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 6
Time spent in forums: 1 h 52 m 24 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by SimonJM Do you know what the file names are that you will be ftp-ing? |
yeah!some sample files..
|

September 24th, 2012, 09:42 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 6
Time spent in forums: 1 h 52 m 24 sec
Reputation Power: 0
|
|
|
#!/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.
|

September 25th, 2012, 06:26 AM
|
|
|
And if you do those steps manually?
Try changing the user/password lines to be just:
Code:
USER $USER $PASSWORD
|

September 26th, 2012, 03:08 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 6
Time spent in forums: 1 h 52 m 24 sec
Reputation Power: 0
|
|
|
it is right that the variable in remote is the ip address of the machine that im going to connect?
|

September 26th, 2012, 06:34 AM
|
|
|
|
Yes, the $REMOTE variable in your script should be the IP or hostname of the server you are connecting to.
|

October 11th, 2012, 07:46 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 1
Time spent in forums: 3 m 4 sec
Reputation Power: 0
|
|
|
I have script,but its very costly...
|

October 12th, 2012, 07:57 AM
|
|
|
Quote: | Originally Posted by desiramba I have script,but its very costly... |
That's nice 
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|