In: , ,
On: 2004 / 01 / 26 Viewed: 41168 times

1. create a script file :

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

CODE:
  1. ftp -inv <script &

3. that's all.

Related posts

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. You can trackback this post from your own site

6 Blablas

  1. 1
    ole Germany »
    commented, on 21/Oct/04 at 1:39 pm # :

    thanks..that helped !

  2. 2
    Scott McNeilly United States »
    said, on 28/Jul/05 at 4:52 pm # :

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

  3. 3
    antz India »
    said, on 15/Sep/07 at 6:29 pm # :

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

  4. 4
    Ozh France »
    said, on 15/Sep/07 at 8:43 pm # :

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

  5. 5
    dbuska Indonesia »
    thought, on 09/Oct/07 at 1:29 pm # :

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

  6. 6
    Alfred Tong Canada »
    commented, on 15/Dec/07 at 2:28 am # :

    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

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Read more ?

 « Better update 
Close
E-mail It