[root@instance-4 ~]# rclone config 2020/06/07 08:36:35 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n #输入n,表示新建 name> goindex Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or typein your own value 1 / 1Fichier \ "fichier" 2 / Alias for an existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" ... 12 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 13 / Google Drive \ "drive" 14 / Google Photos \ "google photos" ...
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> 922792137230-p1hacd0v1r53n2rn34p39cuquut449b6.apps.googleusercontent.com Google Application Client Secret Setting your own is recommended. Enter a string value. Press Enter for the default (""). client_secret> 3SDM_QN36HqgdYIYD0cs1zpQ 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 typein 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 #输入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 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 #输入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 #输入n;如果是在服务器上,这里输入y之后,会给你一个127.0.0.1的网址让你访问授权,这样就无法实现,所以这里选n,会给你一个通用链接,可以在本地电脑上访问授权; Please go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=922792137230-p1hacd0v1r53n2rn34p39cuquut449b6.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=0NMrhpEREX28r25plm3ZwA Log in and authorize rclone for access Enter verification code> 4/0gGbQNwEc40VPc1edE-5XuOl1Ycm0oK1_Gj4OsvTYE3LshQS1eIoZDk Configure this as a team drive? y) Yes n) No (default) y/n> #不是团队盘,就输入n即可 -------------------- [goindex] type = drive client_id = xxx client_secret = xxx scope = drive token = xxx -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y #输入y确认 Current remotes:
Name Type ==== ==== goindex 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 # 输入q退出 [root@instance-4 ~]#
[root@instance-20200730-1319-centos7 ~]# rclone config Current remotes:
Name Type ==== ==== tongjiwgq onedrive
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> d Choose a number from below, or typein an existing value 1 > tongjiwgq remote> 1 No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n name> tongjiwgq Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or typein your own value 1 / 1Fichier \ "fichier" 2 / Alias for an existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" ... 22 / Microsoft OneDrive \ "onedrive" ... Storage> ondedrive ** See helpfor onedrive backend at: https://rclone.org/onedrive/ **
Microsoft App Client Id Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> 16263263-8cb4-460d-8e16-88a10f888fda Microsoft App Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> puvL0J24q4vYXA26qm64FJ-5prf.b_6nG- OneDrive operated by 21Vianet (世纪互联). Enter a boolean value (true or false). Press Enter for the default ("false"). is_21vianet_version> true Edit advanced config? (y/n) y) Yes n) No y/n> n #输入n,不做高级配置,用默认的即可 Remote config 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 n) No y/n> n #输入n,因为这里是ssh连接到远端的机器,并不是在本地机器上挂载 For this to work, you will need rclone available on a machine that has a web browser available. Execute the following on your machine (same rclone version recommended) : rclone authorize "onedrive""16263263-8cb4-460d-8e16-88a10f888fda""puvL0J24q4vYXA26qm64FJ-5prf.b_6nG-"#这里拼接上 --onedrive-is-21vianet-version=true,到一个带有浏览器环境的机器中(也就是要在Windows机器上执行),用cmd执行这条拼接后的完整命令,会弹出网页认证登录;认证完成之后,cmd窗口中会出现该复制的内容,复制黏贴到ssh窗口中下面result的地方; Then paste the result below: result> #上面获取到的内容贴到这里 Choose a number from below, or typein an existing value 1 / OneDrive Personal or Business \ "onedrive" 2 / Root Sharepoint site \ "sharepoint" 3 / Type in driveID \ "driveid" 4 / Type in SiteID \ "siteid" 5 / Search a Sharepoint site \ "search" Your choice> 1 #输入1 Found 1 drives, please select the one you want to use: 0: OneDrive (business) id=b!bmHt7CWXlk61AgIYlM-wftJRCTSL4HVOgQaNud522imBdQfaEXNRQbpWi15wd7Ji Chose drive to use:> 0 #输入0,这里是选择你要使用的盘 Found drive 'root' of type'business', URL: https://universitytongji-my.sharepoint.cn/personal/wgq_alumni_tongji_edu_cn/Documents Is that okay? y) Yes n) No y/n> y #输入y 2020/08/24 23:02:17 ERROR : Failed saving config "drive_id" = "b!bmHt7CWXlk61AgIYlM-wftJRCTSL4HVOgQaNud522imBdQfaEXNRQbpWi15wd7Ji"in section "tongjiwgq" of the config file: section 'tongjiwgq' not found 2020/08/24 23:02:17 ERROR : Failed saving config "drive_type" = "business"in section "tongjiwgq" of the config file: section 'tongjiwgq' not found -------------------- [tongjiwgq] #全部确认完毕后,这里会出现本盘的 所有相关信息,隐私信息用星号代替隐藏 type = onedrive client_id = *** client_secret = *** is_21vianet_version = true token = *** drive_id = *** drive_type = business -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y #输入y Current remotes:
Name Type ==== ==== tongjiwgq onedrive
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 #退出配置
[root@instance-20200730-1319-centos7 ~]# rclone config Current remotes:
Name Type ==== ==== tongjiwgq onedrive
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> albanywgq Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or typein your own value 1 / 1Fichier \ "fichier" ... 13 / Google Drive \ "drive" 14 / Google Photos \ "google photos" ... 34 / premiumize.me \ "premiumizeme" Storage> 13 ** See helpfor 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> Google Application Client Secret Setting your own is recommended. Enter a string value. Press Enter for the default (""). client_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 typein 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> drive 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 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 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 n) No y/n> n #输入n,因为在远端机器,然后会给你一个链接 If your browser doesnt open automatically go to the following link: https:***(隐私隐藏) Log in and authorize rclone for access #粘贴此链接到浏览器无痕模式 Enter verification code> 4/3QF5QkEh5jMOJ0khErJ_6ZLZQhGVbvCk8t81vmbIR58lGaLhHenbHzk #将登录得到的 code贴到这里 Configure this as a team drive? y) Yes n) No y/n> n -------------------- [albanywgq] type = drive scope = drive token = *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Current remotes:
Name Type ==== ==== albanywgq drive tongjiwgq onedrive
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 [root@instance-20200730-1319-centos7 ~]#
挂载
1
rclone mount albanywgq:/cloud/albanywgq --daemon
遇到的问题
1 2 3 4 5 6 7 8 9
# 没带参数执行了一遍 [root@instance-20200730-1319-centos7 ~]# rclone mount albanywgq: /cloud/albanywgq --daemon 2020/08/25 01:27:37 Fatal error: Can not open: /cloud/albanywgq: open /cloud/albanywgq: transport endpoint is not connected
# 此时再把参数带上 [root@instance-20200730-1319-centos7 /cloud]# rclone mount albanywgq: /cloud/albanywgq/ --umask 0000 --default-permissions --allow-non-empty --allow-other --transfers 8 --buffer-size 256M --low-level-retries 200 --dir-cache-time 12h --vfs -read-chunk-size 256M --vfs-read-chunk-size-limit 3G --daemon 2020/08/25 01:29:59 mount helper error: fusermount: failed to access mountpoint /cloud/albanywgq: Transport endpoint is not connected 2020/08/25 01:29:59 Fatal error: failed to mount FUSE fs: fusermount: exit status 1