Last active
January 19, 2020 00:28
-
-
Save ogtfaber/1efa6a367ff86a87ef2c92bc0315d624 to your computer and use it in GitHub Desktop.
Copy Google Drive file to Google Storage account (using Colab)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mount drive | |
from google.colab import drive | |
drive.mount('/content/drive') | |
# Mount storage account | |
project_id = 'rm-pulse' | |
from google.colab import auth | |
auth.authenticate_user() | |
!gcloud config set project {project_id} | |
# Copy file | |
bucket_name = 'your-bucket-name' | |
drive_directory = '/content/drive/.../...' | |
drive_file = 'your-drive-file' | |
bucket_directory = 'your-destination-directory' | |
!gsutil -mq cp {drive_directory}/{drive_file} gs://{bucket_name}/{bucket_directory}/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment