bk node and refactor

This commit is contained in:
il
2026-06-23 10:57:10 +09:00
parent 927b5b4934
commit fe146b25c7
131 changed files with 2310 additions and 920 deletions
@@ -0,0 +1,13 @@
[gdrive]
type = drive
client_id = {{ hostvars['console']['rclone']['google_drive']['oidc']['id'] }}
client_secret = {{ hostvars['console']['rclone']['google_drive']['oidc']['secret'] }}
scope = drive
token = {{
{
"access_token":"expired",
"token_type":"Bearer",
"refresh_token":hostvars['console']['rclone']['google_drive']['refresh_token'],
"expiry":"1970-01-01T00:00:00Z",
} | to_json
}}
@@ -0,0 +1,28 @@
[Unit]
Description=Daily Kopia rclone backup service
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
# logging
StandardOutput=journal
StandardError=journal
Environment="RCLONE_CONFIG=/etc/secrets/{{ node['uid'] }}/rclone/rclone.config"
ExecStart=/usr/bin/rclone copy %h/data/kopia/ gdrive:kopia \
--transfers=4 \
--checkers=4 \
--tpslimit=8 \
--tpslimit-burst=4 \
--drive-chunk-size=64M \
--retries=20 \
--low-level-retries=10 \
--retries-sleep=30s \
--timeout=3m \
--contimeout=30s \
--drive-stop-on-upload-limit \
--stats=30s \
--log-level=INFO
@@ -0,0 +1,10 @@
[Unit]
Description=Daily Kopia rclone backup timer
[Timer]
OnCalendar=*-*-* 09:00:00
Persistent=true
RandomizedDelaySec=300
[Install]
WantedBy=timers.target