permissions
This commit is contained in:
@@ -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"; }
|
||||
|
||||
Reference in New Issue
Block a user