简体   繁体   English

将目录从本地计算机移动到GCP中的实例

[英]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: 我正在尝试在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. 我有两个项目,并使用合适的项目设置了gcloud。

The answer is inspired by: gcloud compute copy-files succeeds but no files appear 答案的灵感来自于: gcloud computing copy-files成功但没有文件出现

I needed to write username@instance, thus this works: 我需要写username @ instance,这样可以工作:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM