[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: I need help to use find and curl together to upload a directory
From: |
Christoph Roland Murauer |
Subject: |
Re: I need help to use find and curl together to upload a directory |
Date: |
Tue, 13 Aug 2013 01:35:02 +0200 |
Am 12.08.2013 um 18:46 schrieb James Youngman <address@hidden>:
> I don't clearly understand the problem you are trying to describe (you
> might find it helpful to review
> http://www.catb.org/esr/faqs/smart-questions.html). Are you saying
> that find launches curl with an incorrect command-line? If so, what
> command-line did you want and what are you getting? If curl is being
> launched with the command-line you expect, but you are not getting the
> result you hope for, this is likely a problem that you should take up
> with the curl user mailing list and/or developers.
I don't know which part is the problem (find, curl or me). Maybe I kept my
question a littlebit to short.
> But since you are passing --ftp-create-dirs to curl, perhaps you don't
> want to pass any directories as the expansion of {} when invoking
> curl. If that's the case you could just put "-type f" on find's
> command-line before the "-exec".
I have on the FTP a directory call images.
I have the following local structure which I want to upload (_site, css, images
and posts are directories).
_site
|- archive.html
|- css
| |- default.css
|- images
|. |- whatever.png
|- index.html
|- posts
|- whatever.html
After running (inside the _site directory)
find . -exec curl --ftp-create-dirs -T {} -v -k -u address@hidden:password
ftp://server/directory --ftp-ssl \;
... I had the following on the FTP.
archive.html
css
default.css
images
whatever.png
index.html
posts
whatever.html
css and posts are created as empty files (like with touch) and not as
directories like in the original structure. images is still a directory and
untouched.
Find should query the directory _site and forward the result to curl. Curl
should upload everything and if it is a directory which doesn't exist on the
FTP, then curl should creat it as a directory and not as a file.