gcloud compute copy-file - no such file or directory

2.1k Views Asked by At

for the following command

gcloud compute copy-files c:/localfile.js loggeduser@instance-name:/resources/js --zone us-central-1

pscp: unable to open /resources/js: no such file or directory

What should be the correct remote destination path to upload a file to vm on war relevent path /resources/js ?

1

There are 1 best solutions below

0
On

You'll need to use the absolute path to the destination folder on the instance. For example

gcloud compute copy-files c:/localfile.js loggeduser@instance-name:/myAwesomeApp/src/main/webapp/resources/js --zone us-central-1

You can also use relative path to the loggeduser's home directory. Assuming the home directory is /home/loggeduser and the project is at the root directory, the command for the above example will be

gcloud compute copy-files c:/localfile.js loggeduser@instance-name:../../myAwesomeApp/src/main/webapp/resources/js --zone us-central-1

It's also important to make sure that 'loggeduser' has necessary permissions, otherwise you may receive 'permission denied' errors.