Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
habrok:data_management:google_drive [2024/08/23 13:24] – removed pedro | habrok:data_management:google_drive [2024/09/27 16:05] (current) – [Using Google Drive Upload] pedro | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Data transfer with Google Drive ====== | ||
+ | There is a preinstalled software module on Hábrók named [[https:// | ||
+ | |||
+ | **Please be mindful of your data management and data archival requirements**. Google Drive is a very helpful tool to save and access files but it is not recommended as an appropriate storage solution for research data archival. Consider using tools hosted at the university like the [[[[rdms: | ||
+ | |||
+ | ===== Loading the application ===== | ||
+ | |||
+ | Loading '' | ||
+ | |||
+ | |||
+ | ===== Setting up Google Drive' | ||
+ | |||
+ | There are extended instructions in the initial setup page of the official [[https:// | ||
+ | |||
+ | - Make sure you are logged in with your university account if you wish to access your RUG Google Drive and enable the Google Drive API on your Google account. You can do so by accessing the [[https:// | ||
+ | - Create a new project. To do so, type " | ||
+ | - It will take a few seconds for your project to be created and the project dashboard should open automatically. If it doesn' | ||
+ | - On the project dashboard, open the side bar menu on the top left and navigate to 'APIs & Services' | ||
+ | - On the 'APIs & Services' | ||
+ | - The previous step should open the ' | ||
+ | - At of the page you should see a message telling you that it is necessary to configure a ' | ||
+ | - Select 'Add or remove scopes' | ||
+ | - In the following page, add your own email to the list of 'Test users' and press 'Save and continue' | ||
+ | - After adding the scopes, go back to the Credentials page by selecting ' | ||
+ | - On the OAuth Client ID section, choose ' | ||
+ | - You should now see a Client ID. Make sure you download the resulting JSON file. The Google Drive API is now complete! | ||
+ | |||
+ | ===== Loading and configuring the application ===== | ||
+ | |||
+ | On your terminal in Hábrók, run: | ||
+ | |||
+ | <code bash> | ||
+ | module load rclone/ | ||
+ | rclone config | ||
+ | </ | ||
+ | |||
+ | - You will see prompt asking to create a new remote. Do so by responding with '' | ||
+ | - Give it a name, such as '' | ||
+ | - Choose Google Drive from the list you obtain by responding with '' | ||
+ | - When prompted for your client ID, paste this value, which you can find in the JSON file you downloaded in the previous section. Do the same when prompted for the client secret. | ||
+ | - Choose the highest access value, that is, 'Full access all files, excluding Application Data Folder' | ||
+ | - When asked for a service account, leave the option blank. | ||
+ | - When prompted to use a web browser to authenticate, | ||
+ | - On the web page you see, log in to your RUG Google Account as usual, and grant the application permission to access your Google Drive. | ||
+ | - The configuration is now complete! You can close the browser and refuse to configure a Shared Drive and to access the advanced setup. | ||
+ | |||
+ | ===== Using Rclone ===== | ||
+ | |||
+ | Once the initial setup is complete, transferring files to and from Google Drive is simple. '' | ||
+ | |||
+ | A list of useful basic options for Google Drive, assuming you named your remote as ' | ||
+ | |||
+ | <code bash> | ||
+ | # List the directories in your Google Drive | ||
+ | rclone lsd gdrive: | ||
+ | |||
+ | # Copy a file called my_file.txt from your $HOME directory to | ||
+ | # a directory called backup on your Google drive | ||
+ | rclone copy $HOME/ | ||
+ | |||
+ | # Copy the my_file.txt in your Google Drive' | ||
+ | # to a directory on Hábrók in $HOME/ | ||
+ | rclone copy gdrive: | ||
+ | |||
+ | # Make the directory $HOME/ | ||
+ | # results on your Google Drive. | ||
+ | # !!!!! This will remove and modify files to make directories identical !!!!! | ||
+ | rclone sync $HOME/ | ||
+ | </ | ||
+ | |||