gsutil

從storage下載檔案

sudo gsutil -m cp gs://[storage路徑] [下載存放位置]

上傳檔案至storage

sudo gsutil cp [file] gs://[storage路徑]

# 如果要上傳資料夾,請加上 -r 參數

參考連結: https://coder.tw/?p=6981

403 insufficient permission

表示執行命令的VM可能沒有讀寫storage的權限

  1. 先關閉VM並開啟編輯,直接將Cloud API 存取權範圍設定為允許所有 Cloud API 的完整存取權;或者只更改storage的權限設定

  2. 打開防火牆

參考連結: http://ps.hsuweni.idv.tw/?p=4751

vm與storage之間的資料夾傳輸

下列指令會將資料從 data 值區與所有子目錄複製到 /mnt/filer 目錄。
gsutil rsync -r gs://data /mnt/filer

下列指令會將資料從 /mnt/filer 目錄與所有子目錄複製到 archive 值區。
gsutil rsync -r /mnt/filer gs://archive

https://cloud.google.com/filestore/docs/copying-data?hl=zh-tw

指用指令操作vm

https://snoopy30485.github.io/2018/06/19/GCP-GoogleCloudPlatform-creat-vm-%E6%8C%87%E4%BB%A4/#%E8%A8%AD%E5%AE%9A%E8%A8%98%E6%86%B6%E9%AB%94%E8%B7%9F-cpu

https://cloud.google.com/sdk/gcloud/reference/compute/instances/create#--accelerator

https://blog.taiker.space/gcp/

Last updated

Was this helpful?