[Tool] rclone 介紹

軟體:rclone
官方網址

功能:掛載雲端硬碟,而且是 open source

設定步驟


  • 前期準備
  • rclone config 設定
    • rclone config
    • 指令如上,依需求設定,google drive 通常依序設定如下
      • n (New remote)
      • name: gd (可任意)
      • 填寫 google drive 的數字 (可依需求選擇)
      • client_id: 可為空,建議填寫自己的 google api,申請網址
      • client_secret: 可為空,建議填寫自己的 google api
      • 權限: 1 (取得完整的權限)
      • root_folder_id: 保持空白,直接 enter
      • service_account_file: 保持空白,直接 enter
      • 修改進階設定: n
      • auto config
        • y 會自動開 browser 處理好一切
        • n 會提供網址,自行填入 browser
      • team drive: n
      • 確認設定: y
      • 離開 config mode: q
  • 掛載雲端硬碟
    rclone mount remote:path /path/to/mountpoint [flags]
    • Ubuntu
      • 建立資料夾,例:/home/gdrive
      • 將先前建立的 gd 掛載至 /home/gdrive 上
        screen -d -m -S rcmount rclone mount gd:/ /home/gdrive --allow-non-empty --vfs-cache-mode writes
    • Windows
      • 建立暫存資料夾,例:d:\Temp
      • 將先前建立的 gd 掛載至 x 槽上
        rclone mount gd:/ x: --cache-dir d:\Temp --vfs-cache-mode  writes --allow-non-empty
  • 卸載雲端硬碟
    • Ubuntu
      • fusermount -qzu /home/gdrive
    • Windows
      • 關掉命令視窗即可

常用指令

全部指令網址

  • rclone config
    • 編輯/新增/刪除 設定檔
  • rclone copy
    • 從 source 複製檔案到 dest,忽略已完成複制的檔案
    • rclone copy source:sourcepath dest:destpath
  • rclone sync
    • 同步 source 和 dest,只改變 dest
    • rclone sync source:path dest:path [flags]
  • rclone move
    • 從 source 移動檔案到 dest
    • rclone move source:path dest:path [flags]
  • rclone delete
    • 刪除檔案
    • rclone delete remote:path [flags]
  • rclone purge
    • 刪除所有檔案
    • rclone purge remote:path [flags]
  • rclone mkdir
    • 建立資料夾
    • rclone mkdir remote:path [flags]
  • rclone rmdir
    • 刪除空資料夾
    • rclone rmdir remote:path [flags]
  • rclone rmdirs
    • 刪除在路徑下所有空資料夾
    • rclone rmdirs remote:path [flags]
  • rclone check
    • 檢查 source 和 dest 的不同處
    • rclone check source:path dest:path [flags]
  • rclone ls
    • 列出檔案,包含大小與路徑
    • rclone ls remote:path [flags]
  • rclone lsd
    • 列出資料夾
    • rclone lsd remote:path [flags]
  • rclone lsl
    • 列出檔案,比 ls 多出修改時間
    • rclone lsl remote:path [flags]
  • rclone version
    • 目前版本
    • rclone version [flags]
  • rclone mount
    • 掛載雲端硬碟
    • rclone mount remote:path /path/to/mountpoint [flags]
  • rclone about
    • 雲端硬碟的資訊
    • rclone about remote: [flags]

參考

Rclone:玩轉Google Drive & One Drive
使用RCLONE掛載GOOGLE DRIVE到雲主機/VPS 擴容硬盤

留言