The gsutil cp command copies the entire directory path (on Windows) - error?

I had a problem where gsutil did not seem to be following the behavior described in the documentation (at least on Windows). The documentation states:


When executing recursive copies of directories, object names are created that reflect the structure of the source catalog, starting from the recursive processing point. For example, the command:

gsutil cp -R dir1/dir2 gs://my_bucket

will create objects with the name gs://my_bucket/dir2/a/b/c, assuming it dir1/dir2contains a file a/b/c.


However, in practice, I found that it will create objects with the name:

gs://my_bucket/dir1/dir2/a/b/c

that is, it copies the entire directory path specified in the command gsutil, and not "starting at the recursive processing point" (dir2), as indicated in the documentation.

Am I missing something / do not understand?

+4
1

gsutil cp -R . "dir2", : gsutil rsync -r dir1/dir2 gs://mybucket

+5

Source: https://habr.com/ru/post/1543458/


All Articles