Why is this gcloud compute copy-files producing an error message?

♀尐吖头ヾ 提交于 2019-12-03 23:43:11

Thanks asking this! This appears to be a bug in gcloud that we're now tracking. The issue is that gcloud compute copy-files is interpreting the colon in C:\Users\fNam... as a part of a remote path. As suggested by George's answer, the work around is to avoid local paths containing the colon character.

In order to copy the file testtext.txt that you are specifying, you need to be in the path where that file is and specify its name while copying not the path.

Example: from your command line lets suppose you are in this path:

C:\Users\fName lName\Desktop\

Your command should be the following:

gcloud compute copy-files --zone europe-west1-b testtext.txt instancename:/PATH_where_you_want_the_file

For example, to copy a remote directory to your local host, run:

   gcloud compute copy-files \
      my-instance:~/remote-dir \
      ~/local-dir \
      --zone us-central1-a

In the above example, “/remote-dir” from “my-instance” is copied into the “/local-dir” directory. Conversely, files from your local computer can be copied to a virtual machine:

gcloud compute copy-files \
    ~/my-local-file-1 \
    ~/my-local-file-2 \
    my-instance:~/remote-destination \
    --zone us-central1-a

Here's a real live example for you:

Copy a remote file directory to your local host, run:

gcloud compute copy-files \
      instance-4:~/ \
      ~/Desktop/project/scripts/step/folder/* \
      --zone asia-east1-a \
      --project 911911911911911 \

All files from your local computer can be copied to a virtual machine:

gcloud compute copy-files \
    ~/Desktop/project/scripts/step/folder/* \
    instance-3:~/ \
    --zone asia-east1-a \
    --project 911911911911911 \

instead of "C:\Users\fName lName\Desktop\testtext.txt"
use "\Users\fName lName\Desktop\testtext.txt" . That worked for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!