(WIP): Backup to Google Drive with Rclone

# 描述

About Rclone (opens new window)

Rclone is a command line program to manage files on cloud storage. It is a feature rich alternative to cloud vendors' web storage interfaces. Over 40 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.

  • [x] rclone 存取 google drive
  • [ ] rclone backup 到 gogole drive 的腳本
  • [ ] crontab 排程執行,並發送執行結果到 Discord

Arch install from AUR yay clone

# rclone 存取 google drive

rclone config
...
sudo mkdir ~/gdrive
rclone mount gd: /mnt/gdrive --allow-non-empty --vfs-cache-mode writes
df -h ~/gdrive

建立在家目錄下; 如果是多人使用電腦,有個 --allow-other-user 選項 df 觀看硬碟用量,確認掛載成功

# 自動掛載 with systemd

# /usr/lib/systemd/system/rclone.service
[Unit]
Description=rclone daemon
After=network.target
 
[Service]
User=ywl
ExecStart=/usr/bin/rclone mount gd: /home/ywl/gdrive --allow-non-empty --vfs-cache-mode writes
ExecStop=/usr/bin/fusermount -uz /home/ywl/gdrive
Restart=on-abort
 
[Install]
WantedBy=multi-user.target

@gist (opens new window)

這個是只掛一個盤的使用,多個盤可以參考 gmag11/rclone-mount@.service (opens new window)

# 小結

乖乖把鳥哥看一遍好嗎!

# References