差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
tech:rclone [2024/04/07 23:25] – 增加 Alpine 安裝 rclone 說明 jonathantech:rclone [2025/04/21 19:38] (目前版本) – [使用 rclone 同步 Google Drive 檔案] jonathan
行 3: 行 3:
 因為愈來愈多檔案存放在 Google Drive, 所以要考慮一個自動的機制將檔案同步回自己的電腦主機內. 因為愈來愈多檔案存放在 Google Drive, 所以要考慮一個自動的機制將檔案同步回自己的電腦主機內.
  
 +<note>
 +**如果需要 Docker Compose 版本可以參考** - [[tech/rclone_docker]]
 +</note>
 ===== 安裝方式 ===== ===== 安裝方式 =====
 ==== Alpine 3 ==== ==== Alpine 3 ====
行 91: 行 94:
 0 2 * * * root rclone copy --max-age 48h --no-traverse -v JonathanGooglePhotos:/ /nas_Photos/GooglePhotos/ 2>&1 | tee /tmp/syncGooglePhotos.log ; cat /tmp/syncGooglePhotos.log | mail -s "RClone Sync Log" [email protected] 0 2 * * * root rclone copy --max-age 48h --no-traverse -v JonathanGooglePhotos:/ /nas_Photos/GooglePhotos/ 2>&1 | tee /tmp/syncGooglePhotos.log ; cat /tmp/syncGooglePhotos.log | mail -s "RClone Sync Log" [email protected]
 </file> </file>
 +</note>
 +
 +<note tip>
 +  * 如果要改用 webhook 方式進行通知(Exp. Discord, Teams...)
 +    - 先安裝 bash, jq 與 curl Exp. <cli>
 +apk add bash jq curl
 +</cli>
 +    - 下載 [[https://raw.githubusercontent.com/tryweb/docker-compose/refs/heads/main/scripts/send_logs_to_discord.sh|send_logs_to_discord.sh]]<cli>
 +curl -o /usr/local/bin/send_logs_to_discord.sh https://raw.githubusercontent.com/tryweb/docker-compose/refs/heads/main/scripts/send_logs_to_discord.sh
 +chmod a+x /usr/local/bin/send_logs_to_discord.sh
 +</cli>
 +    - 將 crontab 內容改成<file>
 +:
 +0 2 * * * root rclone copy --max-age 48h --no-traverse -v JonathanGooglePhotos:/ /nas_Photos/GooglePhotos/ 2>&1 | tee /tmp/syncGooglePhotos.log && send_logs_to_discord.sh TITLE="RClone sync Google Photos..." LOG_FILE="/tmp/syncGooglePhotos.log" WEBHOOK_URL="https://discord.com/api/webhooks/13xxxxxxxxxxxxxxx28/Wxxxxxy-hkxxxxxxxxxxxxxxxxxxxxIOsyuGjyaqxxxxxxxxxxxxxxxxxxxxNJ0kYFnC"
 +
 +</file>  
 </note> </note>
 ===== 更新 rclone 方式 ===== ===== 更新 rclone 方式 =====
行 112: 行 131:
 Now run "rclone config" for setup. Check https://rclone.org/docs/ for more details. Now run "rclone config" for setup. Check https://rclone.org/docs/ for more details.
 </file> </file>
 +
 +
 +===== 啟用 rclone WebUI =====
 +  * 只要加上 rcd --rc-web-gui 就可以啟動 Web UI 的服務
 +  * 如果要外部電腦也可以使用 Web UI 就要加上 --rc-addr 0.0.0.0:5572 
 +  * 再加上登入帳號密碼 Exp. --rc-user admin --rc-pass "MyPass_111"
 +  * Exp. <cli>
 +rclone rcd --rc-web-gui --rc-addr 0.0.0.0:5572 --rc-user admin --rc-pass "MyPass_111" &
 +</cli> \\ {{:tech:螢幕擷取畫面_2025-04-21_135724.png|}}
  
  
  • tech/rclone.1712503520.txt.gz
  • 上一次變更: 2024/04/07 23:25
  • jonathan