Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud compute scp error: All sources must be local files

Tags:

I tried to copy file from my google cloud instance to local machine with the following command:

gcloud compute scp nlp-2:to_test.txt C:\Temp

And got back the following error message:

ERROR: (gcloud.compute.scp) All sources must be local files when destination is remote.  Got sources: [nlp-2:to_test.txt], destination: 
C:Temp

What is exactly wrong? I am confident that the same command worked like 2 days ago.

Update: I am connecting to Ubuntu 16.04 (google instance) from Win 7 (local machine)

like image 276
user1700890 Avatar asked Dec 13 '17 16:12

user1700890


1 Answers

In order to resolve copying files to the instance, I had to create a path in D: (in your case can be C:) the same as the one represented by ~ in the ubuntu instance (/home/example_name/) and put the files to copy in that windows directory:

sudo gcloud beta compute scp --project="projectname" --zone="zonename" ~/Filename.zip instancename:~/

The reason is because the console scp does not support :

like image 95
Pedro Ramírez Avatar answered Oct 26 '22 22:10

Pedro Ramírez