Try   HackMD

win10 Rclone 不思考ㄉ安裝與掛載

1. 安裝

去下載最新版,順便下載winfsp,方便 win10 掛載

  • 解壓縮 rclone,找個好地方放,安裝 winfsp(這個只要下一步安裝法)

  • path 到 rclone,然後去 cmd 打 rclone config

2. 設定

  • n(新增)、取名字、18(應該是 google drive)、弄一個自己的 Google Application Client Id 還有密碼、選 1 拿完整授權、root folder id 跟 service_account_file 無腦下一步就好、n (不用進階設定)、y(使用自動設定)、選帳號、確認、n(不是團隊硬碟)、y(確認建立)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

跳這個是因為 google 安全性的驗證,可是「開發人員」就指的是你,所以鼻用擔心。選進階、繼續、跳出去選授權。

3. 掛載跟自動啟動(不能直接拖曳進去上傳,但是可以拉出來下載,只是相較 copy、move、sync 比較慢)

把下面那份複製貼到 rclone 資料夾裡,貼到文字編輯器之後改掉 WS.Run 的中文內容,然後喵一下註釋。只有掛載一個就把第二個 WS.Run 刪掉。檔名改成 .vbs 。

丟一份到 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp (可以開機自動啟動)

參考這個網站

Option Explicit
Dim WMIService, Process, Processes, Flag, WS
Set WMIService = GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
Set Processes = WMIService.ExecQuery("select * from win32_process")
Flag = true
for each Process in Processes
    if strcomp(Process.name, "rclone.exe") = 0 then
        Flag = false
        exit for
    end if
next
Set WMIService = nothing
if Flag then
    Set WS = Wscript.CreateObject("Wscript.Shell")
    WS.Run "rclone mount 你剛剛取的名字:/ j: --cache-dir F:\Temp --vfs-cache-mode minimal", 0
    WS.Run "rclone mount 掛載超過一個硬碟就寫在這裡:/ k: --cache-dir F:\Temp --vfs-cache-mode minimal", 0
' 依照網路快慢 off(速度大於 100M)>minimal>writes>full(會完全暫存雲端硬碟內容到地腦) 預設是 minimal。
end if

rclone 基本指令

檔案上傳/下載
rclone copy -P --drive-chunk-size=64M --transfers=40 --checkers=40 --stats=10s -v 來源:/ 目的地:/
→ rclone copy(傳新檔案、忽略舊檔。速度比 sync 快)
→ drive-chunk-size(預設是 8M太慢)
→ transfers(預設是 4 )
→ stats(固定時間顯示傳送資訊)
→ v(顯示傳送時間)
→ P(顯示即時傳送速度)

伺服器之間轉傳(不會下載到電腦)多加這個
--drive-server-side-across-configs

from

Google Application Client Id 建立

隨便找個 google 帳號登入,去這邊

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

啟用 api

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

找這個,點進去打開

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這裡

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

右上角這裡,選外部、取名字後直接戳儲存

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這裡

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

選 OAuth 用戶端 ID

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這個然後取名字

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這個就是 Google Application Client Id 的帳號跟密碼~
(因為 google 更新惹安全性的設定,所以會跳出可怕的警告標語。但是 TL;DR 鼻要理他)