In: , ,
On: 2004 / 01 / 26
Shorter URL for this post: http://ozh.in/k

1. create a script file :

  1. open ftp.domain.com
  2. user mylogin mypasswd
  3. lcd /my/local/dir
  4. put myfile
  5. bye
  6. quit

2. call the script :

ftp -inv < script &[/code] 3. that's all.

Shorter URL

Want to share or tweet this post? Please use this short URL: http://ozh.in/k

Metastuff

This entry "Automated FTP script" was posted on 26/01/2004 at 9:18 pm and is tagged with , ,
Watch this discussion : Comments RSS 2.0.

8 Blablas

  1. ole says:

    thanks..that helped !

  2. Thanks. That solved my problem. I had tried "ftp

  3. antz says:

    You may consider using "expect" for automating ftp, telnet etc.

  4. Ozh says:

    Antz » indeed, didn't know this, and it looks rather nice and simple to use. Thanks for the suggestion.

  5. dbuska says:

    how to use ftp behind proxy ftp or firewall, please give me the sample script. Thanks.

  6. Alfred Tong says:

    Yeah that works but to put it inside of a script, this is the solution:)

    ftp -ivn <<EOL
    open FTP_SERVER
    user USERNAME PASSWORD
    lcd /path/to/file
    put file
    bye
    quit
    EOL

  7. joe donner says:

    nice one. very helpful. thanks for sharing.

  8. Rohit says:

    simplest solution I found so far.. I'm an iSeries admin and know peanuts about Linux. I need to setup a small demo which involves FTP between various servers.. out of all soutions I came across this was the best for my purpose! Thanks a ton!!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar and sign for a free account
Spam: Various spam plugins may be activated. I'll put pins in a Voodoo doll if you spam me.

Read more ?

 « Better update