Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving a directory from local-machine to an instance in GCP

I am trying to move a folder from my local machine to the remote server in an instance of GCP:

gcloud compute scp --recurse myDirectory instance-1:~/Folder

It looks like it is uploaded (because I see the files uploading), but when I checked the folder at the remote server there is nothing. What I am doing wrong?

I have two projects and I set up gcloud with the suitable project.

like image 213
Javiss Avatar asked Sep 12 '25 19:09

Javiss


1 Answers

The answer is inspired by: gcloud compute copy-files succeeds but no files appear

I needed to write username@instance, thus this works:

gcloud compute scp --recurse myDirectory username@instance-1:~/Folder
like image 116
Javiss Avatar answered Sep 15 '25 10:09

Javiss