How do I download a file to a newly created directory with curl on OS X?

You could try using the --create-dirs argument which was added in curl 7.10.3:

Here is an example that will create the directory hierarchy, (if it doesn’t already exist), and will name the subdirectory you require renamed with the output of the datecommand:

curl -o /db-bkups/$(date +"%b-%d-%Y")/timestamp-db.dump --create-dirs http://www.w3schools.com/xml/simple.xml

The result is a file stored in a directory like so /db-bkups/Nov-04-2016/timestamp-db.dump.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)