When I execute the command
gcloud compute copy-files "C:\Users\fName lName\Desktop\testtext.txt" instancename:test.txt --zone europe-west1-a
I receive the error: "All sources must be local files when the destination is remote."
.
Can anyone help me figure out what is wrong?
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With