Skip to content

Instantly share code, notes, and snippets.

@JT501
Last active December 15, 2020 16:00
Show Gist options
  • Save JT501/014aa5556bd8ad80d504c80f06564227 to your computer and use it in GitHub Desktop.
Save JT501/014aa5556bd8ad80d504c80f06564227 to your computer and use it in GitHub Desktop.
Copy files from GCE VM to GCS

1. Login gcloud

gcloud auth login

Login with your project account

2. Copy files / directory

gsutil -m cp -r -a public-read dir/ gs://bucket/uploads

copy directory to GCS destination

-m : muti-threads

-r : recurse

-a : set access right

3. Revoke recent auth

gcloud auth revoke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment