permissions

This commit is contained in:
2026-02-20 21:28:24 +01:00
parent a5f166692f
commit 133f2a816a

View File

@@ -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"; }