From 133f2a816a18db193ad0fa1f1fde8868eda6e4cf Mon Sep 17 00:00:00 2001 From: Stefan Ostermann Date: Fri, 20 Feb 2026 21:28:24 +0100 Subject: [PATCH] permissions --- backup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backup.sh b/backup.sh index c0e654d..62aedf1 100755 --- a/backup.sh +++ b/backup.sh @@ -96,6 +96,9 @@ check_mount # Fail early if the backup base directory doesn't exist (drive not mounted / path wrong) [ -d "$BACKUP_BASE" ] || die "Backup base directory $BACKUP_BASE does not exist." +# Must be able to write into the backup base (e.g. run as root via sudo/cron) +[ -w "$BACKUP_BASE" ] || die "No write permission on $BACKUP_BASE — run as root (sudo)." + # Locking — base dir is confirmed to exist, so the lockfile write will succeed lockfile="${BACKUP_BASE}/.backup.lock" cleanup() { rm -f "$lockfile"; }