Reputation: 129
gcloud compute copy-files /Users/myusername/Pictures/IMG_0382.JPG myusername@my-instance:/var/www --zone asia-east1-c
/Users/myusername/Pictures/IMG_0382.JPG: No such file or directory
ERROR: (gcloud.compute.copy-files) [/usr/bin/scp] exited with return code [1].
I am copy-pasting the file directory into my local terminal. What is the deal? Do I have to modify the .bash
file or something?
Upvotes: 1
Views: 6314
Reputation: 514
The GCP documentation can be found here.
To make it work I had to:
sudo
For permissions~
specified in the documentation.Code:
sudo gcloud compute scp [LOCAL_FILE_PATH] [INSTANCE_NAME]:/ --zone [INSTANCE ZONE]
Example
sudo gcloud compute scp /Users/jb/Downloads/cudnn-8.0-linux-x64-v7.tar instance-1:/home/jb --zone us-west
Upvotes: 0
Reputation: 129
So, it turns out I was not in the right terminal. Instead of ssh-ing into your instance and then issuing the command, you have to open up a fresh terminal window, cd to the appropiate directory (the folder with the desired upload file) and then issue the gcloud compute copy-files LOCAL... yada yada. If you are already connected to your instance, that's fine, just open up a new terminal window.
Upvotes: 4
Reputation: 599
Does this command succeed or fail: ls -ld /Users/myusername /Users/myusername/Pictures/IMG_0382.JPG
The copy and paste most likely did not do what you expected.
Upvotes: 0