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 date
command:
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
.