Thursday, September 7, 2017

gcloud compute scp gotchas

If you're trying to do recursive uploads of files and folders from your local machine into a VM in gcloud using the gcloud SDL shell then you might save yourselves some time by making sure you terminate the remote folder name with the 'trailing slash'. I was seeing the following errors:

 pscp: unable to open
This is what I was actually typing in:

gcloud compute scp c:\mylocalfolder myusername@always-free-instance:/home/myusername/remotefolderName --zone us-central1-c --recurse 

Notice that remoteFolderName had no trailing slash to indicate folderName. Adding the slash fixed the problem
 

No comments: