Find the answer to your Linux question:
Results 1 to 2 of 2
hi friends i need to take a backup from one remote system and send it to server through ftp i need to automate these commands in a file by giving ...
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    3

    Thumbs up how to automate ftp commands

    hi friends

    i need to take a backup from one remote system and send it to server through ftp
    i need to automate these commands in a file by giving user name and password for database as well as ftp as argument

    thougth i am having little bit of knowledge in shell scripts very new to ftp scripts
    so help needed! it would be appriciated

    Regards
    Vajiramani

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    You can put the ftp commands in a here document.
    An example:

    Code:
    #!/bin/sh
    
    HOST='host.com'
    USER='vaji'
    PASSWD='passwd'
    
    ftp -i -n $HOST <<EOF
    user ${USER} ${PASSWD}
    binary
    cd /home
    get my.pdf
    quit
    EOF
    Regards

Posting Permissions

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