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

File from Drive to Cloud Storage

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 2 120
2 REPLIES 2

What is the error you are getting?

Do you need to include the file source path from where it originates and where it will be placed in the cloud???