【发布时间】:2019-11-06 20:28:13
【问题描述】:
我花了太多时间试图弄清楚如何将文件从分配的 Google Cloud Shell VM 复制到我的本地计算机。云外壳很棒,但拥有本地副本也是如此。
大部分时间都花在尝试使某种形式的gcloud compute scp 工作,类似于以下语法:
$ gcloud compute scp some-instance:~/littlefile.zip ~/
不过除了compute 命令,还有alpha cloud-shell!
无效的方法:
me@mylocalhost:~$ gcloud alpha cloud-shell scp ~/littlefile.zip .
ERROR: (gcloud.alpha.cloud-shell.scp) argument (cloudshell|localhost):SRC: Bad value [/home/me/littlefile.zip]: must start with cloudshell: or localhost:
me@mylocalhost:~$ gcloud alpha cloud-shell scp cloudshell:~/littlefile.zip localhost:~/littlefile.zip
~/littlefile.zip: No such file or directory
ERROR: (gcloud.alpha.cloud-shell.scp) [/usr/bin/scp] exited with return code [1].
提及:How to copy files from google compute engine to local directory 以防其他人找到它但需要 Cloud Shell 命令。
【问题讨论】:
标签: google-cloud-platform google-compute-engine google-cloud-shell