兩邊的前次修訂版 前次修改
下次修改 | 前次修改
|
tech:rclone [2024/04/07 23:25] – 增加 Alpine 安裝 rclone 說明 jonathan | tech:rclone [2025/03/17 13:12] (目前版本) – [設定每天 2:00 執行一次] jonathan |
---|
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 方式 ===== |