Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| habrok:data_management:google_drive [2024/08/23 13:24] – created pedro | habrok:data_management:google_drive [2026/09/30 17:30] (current) – pedro | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Data transfer | + | ====== Data transfer |
| + | There is a preinstalled software module on Hábrók named [[https:// | ||
| - | Currently, there is no preinstalled application that lets users connect | + | <WRAP center round important 100%> |
| + | **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 ===== | ||
| - | Please | + | 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 | ||
| + | - 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 top of the page you should see a message telling you that it is necessary to configure a ' | ||
| + | - On the side bar on the left-hand side of the screen, select 'Data Access' | ||
| + | - On the side bar on the left, go to ' | ||
| + | - After adding the scopes, press the 3 horizontal bars at the top left of the screen to open the side bar. Then, navigate to 'APIs & Services -> Credentials. On the Credentials select '+ Create Credentials' | ||
| + | - 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! | ||
| + | |||
| + | After going through these steps you don't need to use the Remote Desktop to use rclone and can use it from the login and interactive nodes (or in compute jobs). | ||
| + | |||
| + | ===== Loading and configuring the application ===== | ||
| + | |||
| + | We will need a browser for the next section, so it is easier to do so via a Remote Desktop Session through the Hábrók Web Portal. Please log in with your university account at https://portal.hb.hpc.rug.nl. | ||
| + | |||
| + | Then, click on ' | ||
| + | |||
| + | You will then see a Linux Desktop Environment with a few icons at the top. The small black square will open a terminal. Press it to open the terminal and load '' | ||
| + | |||
| + | <code bash> | ||
| + | module load rclone/1.66.0 | ||
| + | rclone config | ||
| + | </ | ||
| + | |||
| + | | ||
| + | | ||
| + | - 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. <wrap em>Note! To paste text to the environment you need to copy it first to the clipboard. Open the clipboard by clicking the small white arrow on the left of your screen and then pressing the clipboard icon. Any text you paste in the resulting text box can then be copied inside the desktop environment.< | ||
| + | | ||
| + | - When asked for a service account, leave the option blank. | ||
| + | | ||
| + | - 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 | ||
| + | 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/ | ||
| + | </ | ||