Fix rclone self-install: pipe to bash, not sh

Confirmed the hard way, live: "curl ... | sh" failed outright with a
bare "Syntax error: ( unexpected" on the actual Ubuntu VPS, since
/bin/sh there is dash (POSIX-only) and rclone's install script relies
on bash-specific syntax. Same bug existed in both backup.sh (just added
this session) and restore.sh (pre-existing, never actually exercised
live until now) -- piping to bash instead fixes both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
This commit is contained in:
JasonFraser 2026-10-03 23:47:10 -04:00
parent 8ac5f12acd
commit e569f38e29
2 changed files with 8 additions and 2 deletions

View File

@ -64,7 +64,10 @@ RETENTION_WEEKLY_DAYS="${RETENTION_WEEKLY_DAYS:-56}"
# 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
# Piped to bash, not sh — confirmed the hard way: Ubuntu/Debian's /bin/sh
# is dash (POSIX-only), and rclone's install script uses bash-specific
# syntax that fails under dash with a bare "Syntax error: ( unexpected".
curl -fsSL https://rclone.org/install.sh | bash
fi
# The exact writer set: everything that touches sites/db-data/redis-queue-data/

View File

@ -70,7 +70,10 @@ if ! docker compose version >/dev/null 2>&1; then
fi
if ! command -v rclone >/dev/null 2>&1; then
echo "restore.sh: rclone not found — installing via rclone's official script..."
curl -fsSL https://rclone.org/install.sh | sh
# Piped to bash, not sh — confirmed the hard way: Ubuntu/Debian's /bin/sh
# is dash (POSIX-only), and rclone's install script uses bash-specific
# syntax that fails under dash with a bare "Syntax error: ( unexpected".
curl -fsSL https://rclone.org/install.sh | bash
fi
# Step 2: figure out which object to restore.