Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2007
    Posts
    4

    Unanswered: 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

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    What have you tried? Post some code and explain where are you getting stuck? (or do you want someone else to do your homework?)

  3. #3
    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

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    use
    ftp -n <<EOF

    And for the id and password use
    user $FTP_USR $FTP_PWD

  5. #5
    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

  6. #6
    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> |
    +-----------------------+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •