rclone

Rclone is a command line program to manage files on cloud storage. (Google drive) Rclone mounts any local, cloud or virtual filesystem as a disk on Windows, macOS, linux and FreeBSD, and also serves these over SFTP, HTTP, WebDAV, FTP and DLNA.

Supported providers:

Debian setup

   1 sudo apt install rclone
   2 rclone config
   3 # n) New remote
   4 n/s/q> n
   5 name> remotedrive
   6 #Type of storage to configure.
   7 #Enter a string value. Press Enter for the default ("").
   8 #Choose a number from below, or type in your own value
   9 #12 / Google Drive
  10 #   \ "drive"
  11 Storage> 12
  12 #** See help for drive backend at: https://rclone.org/drive/ **
  13 #Google Application Client Id
  14 #Leave blank normally.
  15 #Enter a string value. Press Enter for the default ("").
  16 client_id> 
  17 #Google Application Client Secret
  18 #Leave blank normally.
  19 #Enter a string value. Press Enter for the default ("").
  20 client_secret> 
  21 #Scope that rclone should use when requesting access from drive.
  22 #Enter a string value. Press Enter for the default ("").
  23 #Choose a number from below, or type in your own value
  24 # 1 / Full access all files, excluding Application Data Folder.
  25 #   \ "drive"
  26 scope> 1
  27 #ID of the root folder
  28 #Leave blank normally.
  29 #Fill in to access "Computers" folders. (see docs).
  30 #Enter a string value. Press Enter for the default ("").
  31 root_folder_id> 
  32 #Service Account Credentials JSON file path 
  33 #Leave blank normally.
  34 #Needed only if you want use SA instead of interactive login.
  35 #Enter a string value. Press Enter for the default ("").
  36 service_account_file> 
  37 #Edit advanced config? (y/n)
  38 #y) Yes
  39 #n) No
  40 y/n> n
  41 #Remote config
  42 #Use auto config?
  43 # * Say Y if not sure
  44 # * Say N if you are working on a remote or headless machine or Y didn't work
  45 #y) Yes
  46 #n) No
  47 y/n> y
  48 #If your browser doesn't open automatically go to the following link: #http://127.0.0.1:53682/auth
  49 #Log in and authorize rclone for access
  50 #Waiting for code...
  51 #Got code
  52 # Configure this as a team drive?
  53 # y) Yes
  54 # n) No
  55 y/n> y
  56 #Fetching team drive list...
  57 #Choose a number from below, or type in your own value
  58 # 1 / XYZ Team
  59 #   \ "..."
  60 Enter a Team Drive ID> 1
  61 #--------------------
  62 #[remotedrive]
  63 #scope = drive
  64 #token = #{"access_token":"...","token_type":"Bearer","refresh_token":"...","expiry":"2???-#09-02T17:51:??.???+01:00"}
  65 #team_drive = XXXXXYXYXY
  66 #--------------------
  67 #y) Yes this is OK
  68 #e) Edit this remote
  69 #d) Delete this remote
  70 y/e/d> y
  71 #Current remotes:
  72 #Name                 Type
  73 #====                 ====
  74 #remotedrive          drive
  75 #e) Edit existing remote
  76 #n) New remote
  77 #d) Delete remote
  78 #r) Rename remote
  79 #c) Copy remote
  80 #s) Set configuration password
  81 #q) Quit config
  82 e/n/d/r/c/s/q> q
  83 
  84 rclone listremotes
  85 # remotedrive:
  86 cd ~
  87 mkdir ~/Documents/remotedrive
  88 fusermount -u  ~/Documents/remotedrive
  89 rclone mount remotedrive: Documents/remotedrive # ctrl+c to unmount/quit
  90 

   1 rclone config
   2 n) New remote
   3 s) Set configuration password
   4 q) Quit config
   5 n/s/q> n
   6 
   7 Enter name for new remote.
   8 name> remotedrive
   9 
  10 Option Storage.
  11 Type of storage to configure.
  12 Choose a number from below, or type in your own value.
  13 19 / Google Photos
  14    \ (google photos)
  15 Storage> 19
  16 Option client_id.
  17 OAuth Client Id.
  18 Leave blank normally.
  19 Enter a value. Press Enter to leave empty.
  20 client_id> 
  21 
  22 Option client_secret.
  23 OAuth Client Secret.
  24 Leave blank normally.
  25 Enter a value. Press Enter to leave empty.
  26 client_secret> 
  27 
  28 Option read_only.
  29 Set to make the Google Photos backend read only.
  30 If you choose read only then rclone will only request read only access
  31 to your photos, otherwise rclone will request full access.
  32 Enter a boolean value (true or false). Press Enter for the default (false).
  33 read_only> false
  34 
  35 Edit advanced config?
  36 y) Yes
  37 n) No (default)
  38 y/n> n
  39 
  40 Use auto config?
  41  * Say Y if not sure
  42  * Say N if you are working on a remote or headless machine
  43 
  44 y) Yes (default)
  45 n) No
  46 y/n> y
  47 
  48 2025/03/09 22:32:17 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=aaaaaa
  49 2025/03/09 22:32:17 NOTICE: Log in and authorize rclone for access
  50 2025/03/09 22:32:17 NOTICE: Waiting for code...
  51 2025/03/09 22:33:47 NOTICE: Got code
  52 Warning
  53 
  54 IMPORTANT: All media items uploaded to Google Photos with rclone
  55 are stored in full resolution at original quality.  These uploads
  56 will count towards storage in your Google Account.
  57 y) Yes (default)
  58 n) No
  59 y/n> y
  60 
  61 Configuration complete.
  62 Options:
  63 - type: google photos
  64 - token: {"access_token":"","token_type":"Bearer","refresh_token":"","expiry":""}
  65 Keep this "remotedrive" remote?
  66 y) Yes this is OK (default)
  67 e) Edit this remote
  68 d) Delete this remote
  69 y/e/d> y
  70 
  71 Current remotes:
  72 
  73 Name                 Type
  74 ====                 ====
  75 remotedrive          google photos
  76 
  77 e) Edit existing remote
  78 n) New remote
  79 d) Delete remote
  80 r) Rename remote
  81 c) Copy remote
  82 s) Set configuration password
  83 q) Quit config
  84 e/n/d/r/c/s/q> q
  85 rclone listremotes 
  86 # remotedrive:
  87 cd ~
  88 mkdir ~/Documents/remotedrive
  89 fusermount -u  ~/Documents/remotedrive
  90 rclone mount remotedrive: ~/Documents/remotedrive

Google drive

   1 rclone config
   2 Current remotes:
   3 
   4 Name                 Type
   5 ====                 ====
   6 remotedrive          google photos
   7 
   8 e) Edit existing remote
   9 n) New remote
  10 d) Delete remote
  11 r) Rename remote
  12 c) Copy remote
  13 s) Set configuration password
  14 q) Quit config
  15 e/n/d/r/c/s/q> n
  16 
  17 Enter name for new remote.
  18 name> googledrive
  19 
  20 Option Storage.
  21 Type of storage to configure.
  22 Choose a number from below, or type in your own value.
  23 18 / Google Drive
  24    \ (drive)
  25 
  26 Storage> 18
  27 
  28 Option client_id.
  29 Google Application Client Id
  30 Setting your own is recommended.
  31 See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
  32 If you leave this blank, it will use an internal key which is low performance.
  33 Enter a value. Press Enter to leave empty.
  34 client_id> 
  35 
  36 Option client_secret.
  37 OAuth Client Secret.
  38 Leave blank normally.
  39 Enter a value. Press Enter to leave empty.
  40 client_secret> 
  41 
  42 Option scope.
  43 Scope that rclone should use when requesting access from drive.
  44 Choose a number from below, or type in your own value.
  45 Press Enter to leave empty.
  46  1 / Full access all files, excluding Application Data Folder.
  47    \ (drive)
  48  2 / Read-only access to file metadata and file contents.
  49    \ (drive.readonly)
  50    / Access to files created by rclone only.
  51  3 | These are visible in the drive website.
  52    | File authorization is revoked when the user deauthorizes the app.
  53    \ (drive.file)
  54    / Allows read and write access to the Application Data folder.
  55  4 | This is not visible in the drive website.
  56    \ (drive.appfolder)
  57    / Allows read-only access to file metadata but
  58  5 | does not allow any access to read or download file content.
  59    \ (drive.metadata.readonly)
  60 scope> 1
  61 
  62 Option service_account_file.
  63 Service Account Credentials JSON file path.
  64 Leave blank normally.
  65 Needed only if you want use SA instead of interactive login.
  66 Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
  67 Enter a value. Press Enter to leave empty.
  68 service_account_file> 
  69 
  70 Edit advanced config?
  71 y) Yes
  72 n) No (default)
  73 y/n> 
  74 
  75 Use auto config?
  76  * Say Y if not sure
  77  * Say N if you are working on a remote or headless machine
  78 
  79 y) Yes (default)
  80 n) No
  81 y/n>  
  82 
  83 2025/03/10 17:21:45 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=aaaa
  84 2025/03/10 17:21:45 NOTICE: Log in and authorize rclone for access
  85 2025/03/10 17:21:45 NOTICE: Waiting for code...
  86 2025/03/10 17:22:29 NOTICE: Got code
  87 Configure this as a Shared Drive (Team Drive)?
  88 
  89 y) Yes
  90 n) No (default)
  91 y/n> 
  92 
  93 Configuration complete.
  94 Options:
  95 - type: drive
  96 - scope: drive
  97 - token: {}
  98 - team_drive: 
  99 Keep this "googledrive" remote?
 100 y) Yes this is OK (default)
 101 e) Edit this remote
 102 d) Delete this remote
 103 y/e/d> 
 104 
 105 Current remotes:
 106 
 107 Name                 Type
 108 ====                 ====
 109 googledrive          drive
 110 
 111 e) Edit existing remote
 112 n) New remote
 113 d) Delete remote
 114 r) Rename remote
 115 c) Copy remote
 116 s) Set configuration password
 117 q) Quit config
 118 e/n/d/r/c/s/q> q
 119 
 120 cd ~
 121 mkdir ~/Documents/googledrive
 122 fusermount -u  ~/Documents/googledrive
 123 rclone mount googledrive: ~/Documents/googledrive

rclone (last edited 2025-03-10 17:26:00 by vitor)