Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload "public" directory to Google Cloud Storage

Using this command from SSH I can upload a whole folder into Google Cloud Storage:

gsutil cp -R folder_big gs://bucket_name

Those are files inside the folder:

enter image description here

I don't want to click individually on each file to make it public.

How do I make the folder (and all files inside) automatically public on upload?

like image 925
My Name Avatar asked Mar 15 '23 15:03

My Name


1 Answers

You could do:

gsutil cp -a public-read -R folder_big gs://bucket_name

Note: if it's a large folder you would likely get a substantial performance improvement if you use the multi-threading option:

gsutil -m cp -a public-read -R folder_big gs://bucket_name
like image 169
Mike Schwartz Avatar answered May 13 '23 19:05

Mike Schwartz