If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Need help in FTPing files Using Shell

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-29-07, 12:44
raghav1982 raghav1982 is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
Need help in FTPing files Using Shell

Hi All

Need a help

Script has to prompt the User to enter the source host server with user id and login

and once login it should get a file from a directory and ftp the file to the target server

The target server will be entered by user ...


Can any one help me on this ..

Thanks all
Reply With Quote
  #2 (permalink)  
Old 11-30-07, 04:49
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
What have you tried? Post some code and explain where are you getting stuck? (or do you want someone else to do your homework?)
Reply With Quote
  #3 (permalink)  
Old 11-30-07, 06:07
raghav1982 raghav1982 is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
THis is my Code , it is not working , can you plese help me on that
#!/bin/sh
echo " Please Enter the FTP Server Address :"
read FTP_SRVR
echo "Please Enter the User id :"
read FTP_USR
echo "Please enter the FTP Password :"
read FTP_PWD
ifile="/home/app/ins/seven/rem/"
ofile="/home/app/ins/six/ddf"
ftp <<EOF
open $FTP_SRVR
user $FTP_USR
pass $FTP_PWD
ascii
cd $ifile
lcd "$ofile"
mget *.*
bye
EOF
Reply With Quote
  #4 (permalink)  
Old 11-30-07, 08:45
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
use
ftp -n <<EOF

And for the id and password use
user $FTP_USR $FTP_PWD
Reply With Quote
  #5 (permalink)  
Old 11-30-07, 16:01
raghav1982 raghav1982 is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
Quote:
Originally Posted by pdreyer
use
ftp -n <<EOF

And for the id and password use
user $FTP_USR $FTP_PWD
yes got it , i am almost done here with my last condition

but i have a requirement that my filename and directory paths are not Static , so i need to define the directory to login to the source server and need to define the filenames and also need to define where i need to place the file (get) to the target server

Can all these defined can be kept in Param , not sure how to do
Reply With Quote
  #6 (permalink)  
Old 12-01-07, 15:13
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 325
Quote:
Originally Posted by raghav1982
yes got it , i am almost done here with my last condition

but i have a requirement that my filename and directory paths are not Static , so i need to define the directory to login to the source server and need to define the filenames and also need to define where i need to place the file (get) to the target server

Can all these defined can be kept in Param , not sure how to do
raghav1982,
you already have been given plenty of assistance on at least one other forum - with examples and code samples.
All you need to do is to be willing to take an extra step to "help yourself".
__________________
vlad
+-----------------------+
| #include <disclaimer.h> |
+-----------------------+
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On