1
votes

Using gsutil in a script a need to upload a file and create all its parents.

Here the (ugly) only solution I found

 gsutil cp -r ./p0/p1/p2/my_file  gs://my_bucket/p0/p1/p2

I'm looking for

gsutil cp -? ./p0/p1/p2/my_file  gs://my_bucket/

To have /p0/p1/p2 structur created in gs bucket.

1
I'm not sure I understand what you're trying to achieve. Can you give an example command using the unix cp command that you're trying to emulate with gsutil? - jterrace
I want to emulate the ‘--parents’ option of cp - Ali SAID OMAR

1 Answers

1
votes

gsutil cp /path/to/my_file gs://foo/bar/my_file should do what you're looking for.