0

I am trying to copy all the data from source bucket to destination bucket using below command recursively

gcloud storage cp -r "gs://test-1" "gs://test-3" --encryption-key=XXXXXXXXXXXXXXXX --manifest-path=test-manifest.csv --storage-class=REGIONAL

Logs from above command

Copying gs://test-1/abcd/efgh/jklm to gs://test-3/test-1/abcd/efgh/jklm 

However test-1 is getting copied into test-3 bucket as a directory.

I want to keep test-1 structure same as test-3 like.

Copying gs://test-1/abcd/efgh/jklm to gs://test-3/abcd/efgh/jklm 

I tried gsutil cp as well but it gave me same issue.

rsync command is not working at all and exiting.

How can i preserve the structure while copying ?

SRJ
  • 2,092
  • 3
  • 17
  • 36

1 Answers1

2

Using Wildcards

It is possible to preserve the directory structure with the help of wildcards.

gcloud storage cp -r "gs://test-1/*" "gs://test-3" --encryption-key=XXXXXXXXXXXXXXX

Reference :

https://cloud.google.com/storage/docs/wildcards#surprising-behavior

SRJ
  • 2,092
  • 3
  • 17
  • 36