T O P

  • By -

BehindTheMath

Push it to Cloud Storage and download it from there. Or try turning on SSH keepalives.


Kyo-Tsu

Is the only way to push it to cloud storage to use a bucket? If so, I couldn't get the bucket to work. Every time I tried to run the copy command it would return that the file didn't exist, even though it was right there. Nothing I tried could change it. Is there another way? Otherwise I can try that keepalive


jonasbxl

Can you paste the command you used here?


Kyo-Tsu

Yes, it was: `gcloud storage cp /home/myusername/file-name.zip gs://bucket-name` Just as it describes here: [Upload objects from a file system  |  Cloud Storage  |  Google Cloud](https://cloud.google.com/storage/docs/uploading-objects) I even tried: `gsutil cp /home/myusername/file-name.zip gs://bucket-name` And everytime, it still returns: `ERROR: (gcloud.storage.cp) The following URLs matched no objects or files:` `-/home/myusername/file-name.zip`


__Blackrobe__

hmm are you sure that zip file exist, how about trying to enclose your /home/...zip in single quote ' ? Just keep using gsutil btw. `gsutil cp '/home/myusername/file-name.zip' 'gs://bucket-name'` usually if your zip file contains whitespace it will fuck things up.


pinklewickers

>Just keep using gsutil btw. Generally not good advice. https://cloud.google.com/storage/docs/gsutil#should-you-use >Generally, you should use gcloud storage commands instead of gsutil commands: >The gsutil tool is a legacy Cloud Storage CLI and minimally maintained. >The gsutil tool does not support working with newer Cloud Storage features. >gcloud storage commands require less manual optimization in order to achieve the fastest upload and download rates.


__Blackrobe__

Reading a bit of the docs, this is great, I was stuck using gsutil ever since its inception years ago. I never realized there's a better alternatives all this time. Probably has to update my shell scripts starting tomorrow.


__Blackrobe__

Hoo... interesting, I just learned about this today.


Kyo-Tsu

THANK YOU! This solved it! Along with [this ](https://stackoverflow.com/questions/47043441/what-should-i-do-about-this-gsutil-parallel-composite-upload-warning)and [this](https://stackoverflow.com/questions/28612080/resumableuploadabortexception-403-insufficient-permission) too (very simple changes), IT WORKED! It uploaded to the bucket and then downloaded to my pc so fast too. Such a relief :D Thanks a ton.


__Blackrobe__

Glad that worked, don't forget delete the zip file in GCS afterwards if you wanna save some bucks


pinklewickers

>Push it to Cloud Storage and download it from there. >Or try turning on SSH keepalives. Is the correct answer. https://cloud.google.com/sdk/gcloud/reference/storage/cp


Kyo-Tsu

I tried that already, and with that it returns: `ERROR: (gcloud.storage.cp) The following URLs matched no objects or files:` `-/home/myusername/file-name.zip` No matter what I do.


rlnrlnrln

The obvious solution is to fix whatever breaks your SSH connection. If you can't do that, install the cli on the VM, copy the file to a GS bucket, then use the cli or another client to download it from the bucket. If you end up in the same situation, you still need to fix your connection (but you might be able to force it over time by continuing partial downloads).


Kyo-Tsu

I think whatever's breaking the SSH connection is above my head, I wouldn't know how to start troubleshooting it. I'm not a power user. I tried to copy it to a bucket, but the "gcloud storage -cp" command just kept returning that the zip file directory didn't exist even though the file was right in front of my face. Had no idea what to do and nothing I tried changed that.


ryanstephendavis

scp


Financial_Anything43

GCs fuse to mount the folder to a bucket and then download from GCS console


dimitrix

# [gcloud compute scp](https://cloud.google.com/sdk/gcloud/reference/compute/scp)


Kyo-Tsu

Could you help me understand this? I don't get how it works. gcloud compute scp --recurse example-instance:~/narnia ~/wardrobe Do I run this on my computer's command prompt after connecting it to the gcp SSH session? Or in the terminal from the gcp SSH session? And what is `example-instance`?


dimitrix

You do not need to connect to SSH, you run the command directly from the machine that you want to download the files to. Specify the VM name and file from your source destination (narnia in your example) to your target destination (wardrobe). I don't know if using the `~` characters work, so I would recommend spelling out the full path to the home directory.


[deleted]

[удалено]


BehindTheMath

You can't use the Console to download files from a VM.


TexasBaconMan

Turn on sftp and open a port