1
votes

I am trying to copy the files and folders from google cloud storage to vm machine using gsutil command but i need to exclude few of the folders in the gcs bucket while copying to vm, i tried searching for the options but i couldn't find it, please help if anyone knows the command for this.

Thanks in-advance,

1

1 Answers

1
votes

For this you can use a command like:

gsutil -m rsync -r -x '^dir3/*' gs://bucket

this should retrieve all objects located on the bucket, except objects beginning with dir3 (files not located in dir3 directory in your example).

Here you can find more details about the rsync command