From e569f38e29c1fce77c3065e0d5bdf7253b4d1274 Mon Sep 17 00:00:00 2001 From: JasonFraser Date: Sat, 3 Oct 2026 23:47:10 -0400 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y --- backup/backup.sh | 5 ++++- backup/restore.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backup/backup.sh b/backup/backup.sh index dd3f9bc..0e7d8de 100755 --- a/backup/backup.sh +++ b/backup/backup.sh @@ -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/ diff --git a/backup/restore.sh b/backup/restore.sh index a7ab66f..049f81c 100755 --- a/backup/restore.sh +++ b/backup/restore.sh @@ -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.