Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

From Google Drive to Google Cloud Storage File

Hi to all

Tring to send a file from Google Drive to Google Cloud Storage Bucket using Google Colab. I believe the issue is in the Drive file path at the end of the code.

Finally at the bottom you will find different variations that I have used for the file path inside Google Drive, any help or advice more than appreciated

The code:

from google.colab import drive
drive.mount('/content/drive')


auth.authenticate_user()
project_id = 'yyyyyyyyy'
!gcloud config set project {project_id}
!gsutil ls

bucket_name = 'xxxxxx'

!gsutil -m cp -r '/content/drive/MyDrive/1 Colab Notebooks/INDICATOR PROJECTS/EURUSD1_Clean.csv'\ Drive/Data/* gs://{bucket_name}/
!gsutil -m cp -r MyDrive/1 Colab Notebooks/INDICATOR PROJECTS/EURUSD1_Clean.csv\ Drive/Data/* gs://{bucket_name}/
!gsutil -m cp -r 'MyDrive/1 Colab Notebooks/INDICATOR PROJECTS/EURUSD1_Clean.csv'\ Drive/Data/* gs://{bucket_name}/

 

0 4 2,047
4 REPLIES 4

It also seems to me that the problem is most likely in the file path, try changing it.

My friend used to send files this way and had no problem with it before. Maybe it's some kind of local glitch. I haven't used Google Drive for a long time

My friend used to send files this way and had no problem with it before. Maybe it's some kind of local glitch. I haven't used Google Drive for a long time. A couple of years ago I found fastupload.io local storage, and now I use only it, it is very convenient. What I like most is that I can upload files to this cloud and share them directly through it. In short, for me it is as convenient as possible, and there are many times less problems than with Google Drive.

@holguinmora would you mind changing the topic labels for your question. Logging and Error Reporting services seem unrelated to what you are asking.

Top Solution Authors