Add setup.sh with nightly systemd timer; move key and excludes into /opt/backup

This commit is contained in:
Christoph Haas 2026-09-19 20:36:47 +00:00
parent 99c716d35b
commit 2db05c9bb6
6 changed files with 151 additions and 27 deletions

View file

@ -9,28 +9,16 @@ source "$SCRIPT_DIR/backup.env"
# BACKUP-SPECIFIC CONFIGURATION
# ==============================================================================
BACKUP_LABEL="${HOSTNAME}-root"
EXCLUDE_FILE="/etc/proxmox-backup/defaults.exclude"
# Create a default exclude file if it doesn't exist
if [ ! -f "$EXCLUDE_FILE" ]; then
mkdir -p "$(dirname "$EXCLUDE_FILE")"
cat << 'EOF' > "$EXCLUDE_FILE"
/proc/*
/sys/*
/dev/*
/run/*
/tmp/*
/mnt/*
/media/*
/lost+found
/var/tmp/*
/var/cache/*
EOF
fi
EXCLUDE_FILE="/opt/backup/exclude"
# ==============================================================================
# EXECUTION
# ==============================================================================
if [ ! -f "$EXCLUDE_FILE" ]; then
echo "error: exclude list not found at $EXCLUDE_FILE — run setup.sh first" >&2
exit 1
fi
echo "Starting Proxmox Backup for ${HOSTNAME}..."
EXCLUDE_ARGS=()