Fix permission errors and variable scope issues

This commit is contained in:
robojerk 2025-06-25 17:51:36 -07:00
parent d5bc2a9d0d
commit ecaca99b8f

View file

@ -209,7 +209,7 @@ cleanup_old_backups() {
local keep_versions=$2
log "Cleaning up old backup directories (keeping $keep_versions)"
find "$path/backups" -maxdepth 1 -type d -name "backup-*" | sort -r | tail -n +$((keep_versions + 1)) | xargs -r rm -rf
find "$path/backups" -maxdepth 1 -type d -name "backup-*" 2>/dev/null | sort -r | tail -n +$((keep_versions + 1)) | xargs -r rm -rf
}
# Function to send webhook notification
@ -321,7 +321,7 @@ process_stack() {
fi
# Ensure lock is released on exit
trap 'release_lock "$lock_file"' EXIT
trap 'release_lock "'"$lock_file"'"' EXIT
log "Processing stack $name"