Backup des Proxmox PVE-Host

Der Proxmox VE-Server kann nicht mit der eigenen Backup-Funktion oder dem Proxmox Backup Server gesichert werden.

  • möglich wären Linux Backup-Lösungen
  • der PVE-Server ist schnell wieder installiert
  • der Installer macht das System (RPOOL) platt!
  • alle wichtigen Config-Files vorher(!) sichern
  • möglichst keine VMs auf RPOOL sichern

Backup PVE-Host (3 Kopien)

  • PVE: zfs list  - suche geeigneten Storage für Backups (Bsp: /hd-vol3/Backups)
  • PVE: touch /home/pve-backup.sh  - erstelle Backup-Script
  • PVE: nano /home/pve-backup.sh
    #!/bin/bash
    # PVE - Backup

    # Definiere destinationdir und Logfile
    DEST="/hd-vol3/Backups/host1"
    LOG="/hd-vol2/daten2/Uwe/logfiles/backup_monat_PVE-Host--PVE.log"

    echo "*** Backup PVE-Host nach $DEST-kopie1" &> "$LOG"
    echo `date` &>> "$LOG"

    # lösche kopie3
    if [ -d "$DEST-kopie3" ]
    then
    echo " Lösche $DEST-kopie3" &>> "$LOG"
    rm -r "$DEST-kopie3"
    fi

    # Verschiebe kopie2 -> kopie3
    if [ -d "$DEST-kopie2" ]
    then
    echo " Move $DEST-kopie2 -> $DEST-kopie3" &>> "$LOG"
    mv "$DEST-kopie2" "$DEST-kopie3"
    fi

    # Verschiebe &DEST-kopie1 in kopie2
    if [ -d "$DEST-kopie1" ]
    then
    echo " Move $DEST-kopie1 -> $DEST-kopie2" &>> "$LOG"
    mv "$DEST-kopie1" "$DEST-kopie2"
    fi

    # erstelle $DEST
    echo " Erstelle $DEST-kopie1" &>> "$LOG"
    mkdir "$DEST-kopie1"

    # r - recursiv
    # h - human readable
    rsync -rptgoh --progress --stats "/etc/" "$DEST-kopie1"etc &>> "$LOG"
    rsync -rptgoh --progress --stats "/home/" "$DEST-kopie1"home &>> "$LOG"
    rsync -rptgoh --progress --stats "/boot/" "$DEST-kopie1"boot &>> "$LOG"
    rsync -rptgoh --progress --stats "/root/" "$DEST-kopie1"root &>> "$LOG"
    # Dumps nicht mit sichern
    rsync -rptgoh --exclude='lib/vz/dump/' --progress --stats "/var/" "$DEST-kopie1"var &>> "$LOG"
  • Script per Cronjob im gewünschten Intervall ausführen

von Uwe Kernchen

Kommentare

Einen Kommentar schreiben

Bitte rechnen Sie 9 plus 8.