diff --git a/backup/backup.sh b/backup/backup.sh index 05e4a83..a79a044 100755 --- a/backup/backup.sh +++ b/backup/backup.sh @@ -48,6 +48,16 @@ set -a; source "${ENV_FILE}"; set +a RETENTION_DAILY_DAYS="${RETENTION_DAILY_DAYS:-14}" RETENTION_WEEKLY_DAYS="${RETENTION_WEEKLY_DAYS:-56}" +# Confirmed the hard way: nothing installs rclone on a fresh VPS before this +# script's first run — restore.sh already self-installs it (mirrored here, +# same install.sh), but backup.sh didn't, so the very first scheduled run on +# a brand-new box failed after already stopping every writer container. +# Checked up front, before anything stateful happens below. +if ! command -v rclone >/dev/null 2>&1; then + echo "backup.sh: rclone not found — installing via rclone's official script..." + curl -fsSL https://rclone.org/install.sh | sh +fi + # The exact writer set: everything that touches sites/db-data/redis-queue-data/ # billing-state. redis-cache and configurator are deliberately excluded — # redis-cache holds nothing persistent (no volume at all) and configurator diff --git a/playbook/INSTALLATION_PLAYBOOK.md b/playbook/INSTALLATION_PLAYBOOK.md index fc21dae..9b907bd 100644 --- a/playbook/INSTALLATION_PLAYBOOK.md +++ b/playbook/INSTALLATION_PLAYBOOK.md @@ -547,7 +547,10 @@ and every gotcha found building it: [`BACKUP_RESTORE.md`](./BACKUP_RESTORE.md). screen; see `BACKUP_RESTORE.md` for exactly where to look. - Retention days, if you want something other than 14 daily / 8 weekly (56 days). 2. Test one backup by hand — `./backup/backup.sh` — confirm it completes and the archive shows up - in the R2 bucket's `daily/` prefix before trusting it to cron. + in the R2 bucket's `daily/` prefix before trusting it to cron. ⚠ **Confirmed the hard way:** on + a brand-new VPS this first run installs `rclone` itself (same self-install `restore.sh` already + did) — nothing to do manually, but the very first run takes a few seconds longer and prints an + install log before the actual backup starts. 3. Add the cron job: ``` crontab -e