Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ module load rclone/1.52.2
$ rclone config

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n
name> gog-remote
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / 1Fichier
   \ "fichier"
 2 / Alias for an existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
...
13 / Google Drive
   \ "drive"
Storage> 13
** See help for drive backend at: https://rclone.org/drive/ **

Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default ("").
client_id> <my-client-id>
Google Application Client Secret
Setting your own is recommended.
Enter a string value. Press Enter for the default ("").
client_secret> <my-secret>
Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / Full access all files, excluding Application Data Folder.
   \ "drive"
 2 / Read-only access to file metadata and file contents.
   \ "drive.readonly"
   / Access to files created by rclone only.
 3 | These are visible in the drive website.
   | File authorization is revoked when the user deauthorizes the app.
   \ "drive.file"
   / Allows read and write access to the Application Data folder.
 4 | This is not visible in the drive website.
   \ "drive.appfolder"
   / Allows read-only access to file metadata but
 5 | does not allow any access to read or download file content.
   \ "drive.metadata.readonly"
scope> 1
ID of the root folder
Leave blank normally.

Fill in to access "Computers" folders (see docs), or for rclone to use
a non root folder as its starting point.

Note that if this is blank, the first time rclone runs it will fill it
ID of the root folder
in with the ID of the root folder.

Enter a string value. Press Enter for the default ("").
root_folder_id>
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Enter a string value. Press Enter for the default ("").
service_account_file>
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> n
Please go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=377328387889-ti2hl4s86m8sm9j24qa9iasrem3rd.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=w252UkKU_oOG0J22eRsbwgredacted
Log in and authorize rclone for access
Enter verification code>

...

Code Block
...
Enter verification code> <copied-code>
Configure this as a team drive?
y) Yes
n) No (default)
y/n> n
--------------------
[gog-remote]
type = drive
client_id = <my-client-id>
client_secret = <my-secret>
scope = drive
token = {"access_token":"redacted","token_type":"Bearer","refresh_token":"redacted","expiry":"2020-11-05T12:57:30.362283974-08:00"}
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
gog-remote           drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

The rclone remote configuration created is Rclone remote configurations are saved in ~/.config/rclone/rclone.conf

...

Copy the contents of a folder from Dropbox Google Drive to Talapas in your current working directory. In this example the folder is ‘MyFirstFolder’ and contains the file ‘perfsonar-pscheduletests.rft’

Code Block
$ rclone copy dbxgog-remote:myFirstFolder .
$ ls -l perfsonar-pscheduletests.rtf
-rw-r--r-- 1 markauser talapasgroup 11693 Jul 22 16:01 perfsonar-pscheduletests.rtf

Copy the contents of all Dropbox Google Drive to Talapas

Code Block
$ rclone copy dbxgog-remote: /projects/hpcrcfpirg/markashared

Copy a file from Talapas to DropboxGoogle Drive

Code Block
$ rclone copy ./hello.txt dbxgog-remote:myFirstFolder
Info

If you use the rclone sync command always run with --dry-run flag first! This command has the potential to delete data.

Re-authenticate rclone

Rclone authentication to Dropbox expires after 4 hours and to continue you will need to reconnect. The process is similar to above as you’ll need to run rclone authorize on your local machine.

On the login node, note the expiration error below. Run rclone config reconnect.

Code Block
$ rclone lsd dbx-remote: 2020/08/06 10:11:36 ERROR : : error listing: Post "https://api.dropboxapi

.

com/2/files/list_folder": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect dbx-remote:": oauth2: token expired and refresh token is not set 2020/08/06 10:11:36 Failed to lsd with 2 errors: last error was: Post "https://api.dropboxapi.com/2/files/list_folder": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect dbx-remote:": oauth2: token expired and refresh token is not set $ $ rclone config reconnect dbx-remote: Already have a token - refresh? y) Yes (default) n) No y/n> y Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config. Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes (default) n) No y/n> n For this to work, you will need rclone available on a machine that has a web browser available. For more help and alternate methods see: https://rclone.org/remote_setup/ Execute the following on the machine with the web browser (same rclone version recommended): rclone authorize "dropbox" -- "<app-key>" "<app-secret>" Then paste the result below: result>

On your local machine, run rclone authorize, click ‘Allow’ in your web browser to approve the connection and copy the resulting code.

Code Block
$ rclone authorize "dropbox" -- "<app-key>" "<app-secret>"
Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=TA_CgzUjNfQpjOA0r4NjCw
Log in and authorize rclone for access
Waiting for code...
Got code
Paste the following into your remote machine --->
{"access_token":"sl.AfRI2twAKidMsDjL81hTKtpACiec61mymDlpPwru7wyFcy0nfAe0k6VyxnyRLM_LbuxaODGs5QpIKFZem6qM46KiBQo8pwD5TiRItBess3MoGl5e9c3Utt_Vsrw5AuByj1c8OFI","token_type":"bearer","expiry":"2020-08-06T14:13:44.524022-07:00"}
<---End paste

On the login node, paste the code and run rclone.

Code Block
... Then paste the result below: result> {"access_token":"sl.AfRI2twAKidMabcd81hTKtpACiec61mymDlpPwru7wyFcy0nfAe0k6VyxnyRLM_LbuxaODGs5QpIKFZem6qM46KiBQo8pwD5TiRItBess3MoGl5e9c3Utt_Vsrw5AuByj1c8OFI","token_type":"bearer","expiry":"2020-08-06T14:13:44.524022-07:00"} $ $ rclone lsd dbx-remote: -1 2020-08-06 10:13:47 -1 myFirstFolder