Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

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, 13: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, 05:49
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
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, 07: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, 09:45
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
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, 17: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, 16:13
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 324
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

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