8

Simple Google Drive backup script with automatic authentication for Google Colab...

 1 year ago
source link: https://gist.github.com/rdinse/159f5d77f13d03e0183cb8f7154b170a
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

ghost

commented

Oct 10, 2018

edited by ghost

Hi Robin, Your technique seems to persist data in Colab Notebook - I used the following config and don't see any data in google drive folder ( id obfuscated for privacy reasons below ) , but data is persistent in Collab Notebook over Browser re-loads and GPU runtime restarts - how do we store a copy of the data in Google Drive - I originally downloaded the data from Kaggle - and used your code to attempt to sync data into GDrive Folder.

The refresh token changes everytime i run the code in collab, but dont see any link or text box, is it because i am already logged into Google and using GDRIVE in another browser session

folder_id = '************************'
dir_to_backup = '/content/data'
mycreds_file_contents = '{"_module": "oauth2client.client", "scopes": [], "token_expiry": null, "id_token": null, "user_agent": "Python client library", "access_token": null, "token_uri": "https://oauth2.googleapis.com/token", "invalid": false, "token_response": null, "client_id": "
.apps.googleusercontent.com", "token_info_uri": null, "client_secret": "####################", "revoke_uri": "https://oauth2.googleapis.com/revoke", "_class": "GoogleCredentials", "refresh_token": "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", "id_token_jwt": null}'
mycreds_file = 'mycreds.json'

Will the data be synced and deleted from Google Drive ? And only kept in Collab Folder ? Or should I begin with data in GDrive ( meaning download data into GDrive and then sync with Colab ?

Thanks for your time !


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK