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:
parent
8ac5f12acd
commit
e569f38e29
|
|
@ -64,7 +64,10 @@ RETENTION_WEEKLY_DAYS="${RETENTION_WEEKLY_DAYS:-56}"
|
||||||
# Checked up front, before anything stateful happens below.
|
# Checked up front, before anything stateful happens below.
|
||||||
if ! command -v rclone >/dev/null 2>&1; then
|
if ! command -v rclone >/dev/null 2>&1; then
|
||||||
echo "backup.sh: rclone not found — installing via rclone's official script..."
|
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
|
fi
|
||||||
|
|
||||||
# The exact writer set: everything that touches sites/db-data/redis-queue-data/
|
# The exact writer set: everything that touches sites/db-data/redis-queue-data/
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,10 @@ if ! docker compose version >/dev/null 2>&1; then
|
||||||
fi
|
fi
|
||||||
if ! command -v rclone >/dev/null 2>&1; then
|
if ! command -v rclone >/dev/null 2>&1; then
|
||||||
echo "restore.sh: rclone not found — installing via rclone's official script..."
|
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
|
fi
|
||||||
|
|
||||||
# Step 2: figure out which object to restore.
|
# Step 2: figure out which object to restore.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue