Recursive Upload with cURL

May 26th, 2010 by James Sullivan | Filed under Uncategorized.

I found myself trying to migrate files from a client’s server to a rackspace cloud sites account.  Unfortunately, the server that was the source did not have lftp, ncftp, or any other ftp client I could use to recursively upload files.  I wrote a script in php then realized that php-cli didn’t have ftp compiled.

Here is the line that I used to upload the data to the rackspace cloud site using a find statement and curl:

find -type f -exec curl -v -u myusername:mypassword –ftp-create-dirs -T {} ftp://ftp3.ftptoyoursite.com/www.mynewwebsite.com/web/content/{} \;

sharing is good:
  • Digg
  • del.icio.us
  • Facebook
  • Reddit
  • Fark
  • TwitThis

Leave a Reply

You must be logged in to post a comment.

  • Author

    Here you can provide some author or blog infomation.