docs(Proxmox): Backupstrategie
This commit is contained in:
73
docs/backup_restore/proxmox/backup_pve_configs.sh
Normal file
73
docs/backup_restore/proxmox/backup_pve_configs.sh
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BACKUP_DIR="/mnt/storagebox-nocrypt/pve-configs-backup"
|
||||||
|
TODAY=$(date +%T_%F)-pve-configs-backup
|
||||||
|
LOGFILE="pve-backup.log"
|
||||||
|
|
||||||
|
mkdir -p "$BACKUP_DIR/$TODAY"
|
||||||
|
|
||||||
|
FILES=(
|
||||||
|
"/root/"
|
||||||
|
"/etc/pve/"
|
||||||
|
"/etc/network/interfaces"
|
||||||
|
"/etc/hosts"
|
||||||
|
"/etc/resolv.conf"
|
||||||
|
"/etc/hostname"
|
||||||
|
"/etc/timezone"
|
||||||
|
"/etc/passwd"
|
||||||
|
"/etc/group"
|
||||||
|
"/etc/shadow"
|
||||||
|
"/root/.ssh/"
|
||||||
|
"/etc/vzdump.conf"
|
||||||
|
"/etc/ssh/sshd_config"
|
||||||
|
"/var/lib/pve-cluster/"
|
||||||
|
"/etc/ssh/"
|
||||||
|
"/etc/cron.d/"
|
||||||
|
"/etc/cron.daily/"
|
||||||
|
"/etc/cron.hourly/"
|
||||||
|
"/etc/cron.weekly/"
|
||||||
|
"/etc/cron.monthly/"
|
||||||
|
"/var/spool/cron/"
|
||||||
|
"/etc/fstab"
|
||||||
|
"/etc/default/"
|
||||||
|
"/etc/apt/sources.list"
|
||||||
|
"/etc/apt/sources.list.d/"
|
||||||
|
"/var/log/"
|
||||||
|
"/etc/systemd/"
|
||||||
|
"/etc/sysctl.conf"
|
||||||
|
"/etc/security/"
|
||||||
|
"/var/backups/"
|
||||||
|
"/etc/fail2ban/"
|
||||||
|
"/root/backup-pve-configs.sh"
|
||||||
|
)
|
||||||
|
|
||||||
|
EXCLUDE_DIRS=(
|
||||||
|
"/mnt/storagebox-crypt"
|
||||||
|
"/mnt/storagebox-nocrypt"
|
||||||
|
"/var/lib/vz/images/"
|
||||||
|
"/var/lib/lxc/"
|
||||||
|
"/var/lib/vz/private/"
|
||||||
|
"/var/lib/lxcfs/"
|
||||||
|
)
|
||||||
|
|
||||||
|
# rsync-Ausschlussparameter erstellen
|
||||||
|
EXCLUDE_PARAMS=()
|
||||||
|
for EXCLUDE in "${EXCLUDE_DIRS[@]}"; do
|
||||||
|
EXCLUDE_PARAMS+=(--exclude="$EXCLUDE")
|
||||||
|
done
|
||||||
|
|
||||||
|
for FILE in "${FILES[@]}"; do
|
||||||
|
if [ -e "$FILE" ]; then
|
||||||
|
echo "Kopiere $FILE..."
|
||||||
|
rsync -aL --relative --ignore-missing-args --safe-links "${EXCLUDE_PARAMS[@]}" "$FILE" "$BACKUP_DIR/$TODAY/" 2>/dev/null
|
||||||
|
else
|
||||||
|
echo "Warnung: $FILE existiert nicht und wird uebersprungen." >> ${LOGFILE}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
find "$BACKUP_DIR" -mindepth 1 -maxdepth 1 -type d -mtime +14 -exec rm -rf {} \;
|
||||||
|
|
||||||
|
echo "Backup fuer $TODAY abgeschlossen." >> ${LOGFILE}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
# Backup Proxmox
|
# Backup Proxmox
|
||||||
|
|
||||||
## 1. PVE
|
## 1. PVE
|
||||||
- Skript: [/root/backup-pve-configs](/proxmox/backup-pve-configs)
|
- Skript: /root/backup-pve-configs.sh
|
||||||
|
|
||||||
|
```snippet
|
||||||
|
--8<-- "/docs/backup_restore/proxmox/backup_pve_configs.sh"
|
||||||
|
```
|
||||||
- Log: /root/pve-backup.log
|
- Log: /root/pve-backup.log
|
||||||
- Location: verschlüsselt auf hetznerstoragebox gemäß Anleitung https://ralf-peter-kleinert.de/linux-server/proxmox-verschluesselt-backup.html. (Die liegt auch als Anhang im bitwarden)
|
- Location: verschlüsselt auf hetznerstoragebox gemäß Anleitung https://ralf-peter-kleinert.de/linux-server/proxmox-verschluesselt-backup.html. (Die liegt auch als Anhang im bitwarden)
|
||||||
- Scedule: täglich im cron und wird 14 Tage aufgehoben
|
- Scedule: täglich im cron und wird 14 Tage aufgehoben
|
||||||
- ÄNDERUNGEN siehe [/etc/fstab](/proxmox/fstab)
|
- ÄNDERUNGEN siehe [/etc/fstab](../proxmox/fstab)
|
||||||
|
|
||||||
# 2. Komplette lxc und VMs #
|
# 2. Komplette lxc und VMs #
|
||||||
- Skript: GUI
|
- Skript: GUI
|
||||||
@@ -21,4 +25,6 @@
|
|||||||
//u358899@u358899.your-storagebox.de/backup/./backups/paperless
|
//u358899@u358899.your-storagebox.de/backup/./backups/paperless
|
||||||
- Scedule: täglich 4:00 für 31 Tage
|
- Scedule: täglich 4:00 für 31 Tage
|
||||||
|
|
||||||
# 4. VM Homeassistent
|
# 4. VM Homeassistent
|
||||||
|
|
||||||
|
|
||||||
@@ -40,6 +40,14 @@ UUID=fe878af4-c44e-4ab8-8d81-1efb0391aaf7 /mnt/DockerDaten ext4 defaults 0
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Backup
|
## Backup
|
||||||
|
|
||||||
|
## aktuelles Skript
|
||||||
|
|
||||||
|
```snippet
|
||||||
|
--8<-- "/docs/docker/wikijs/docker-compose.yml"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
=> [Proxmox Backup](../backup_restore/proxmox_backup.md).
|
=> [Proxmox Backup](../backup_restore/proxmox_backup.md).
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ nav:
|
|||||||
|
|
||||||
- Backup:
|
- Backup:
|
||||||
- Backup: backup/backup.md
|
- Backup: backup/backup.md
|
||||||
- christian-linux: backup_restore/christian-linux_backup.md
|
- christian-linux: backup_restore/workstations/christian-linux_backup.md
|
||||||
- Proxmox: backup_restore/proxmox_backup.md
|
- Proxmox: backup_restore/proxmox/proxmox_backup.md
|
||||||
- Storage: backup/storage.md
|
- Storage: backup/storage.md
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user