proxmox-backup-client RaspberryMatic

Proxmox bietet aktuell keinen Backup Client für die ARM Architektur. (Proxmox Forum: Proxmox-backup-client für arm?)
Dank der Community gibt es aber Abhilfe.

mein setup:

  • Raspberry Pi 3
  • RaspberryMatic 3.73.9.20240130
  • Proxmox Backup Server 3.2
  • Proxmox Backup Client 3.1.2

Installation (aarch64, 64bit)

Architektur ermitteln.

root@pi-matic:~# uname -m
aarch64

Client herunterladen und entpacken. (unofficial binary packages)

# herunterladen und entpacken
cd /usr/local
wget https://github.com/ayufan/pve-backup-server-dockerfiles/releases/download/v3.1.2-1/proxmox-backup-client-v3.1.2-arm64v8.tgz
tar xfz proxmox-backup-client-v3.1.2-arm64v8.tgz
rm proxmox-backup-client-v3.1.2-arm64v8.tgz
mv proxmox-backup-client-v3.1.2 pbs-client

# test
cd pbs-client
./proxmox-backup-client.sh version
client version: 3.1.2

Backup Skript erstellen, z.B. pbs-backup.sh und die 3 exports anpassen.

#!/bin/ash
export PBS_REPOSITORY=backup@pbs@pbs.bachmann.lan:SSD1-1TB
export PBS_PASSWORD=BACKUP-USER-PASSWORD
export PBS_FINGERPRINT="eb:ba:82:13:00:8b:28:aa:13:ca:51:cc:x9:f5:c3:1e:08:82:33:ca:43:38:75:a8:72:68:46:83:27:12:na:se"

cd /usr/local/pbs-client
./proxmox-backup-client.sh backup --dry-run root.pxar:/
# ./proxmox-backup-client.sh backup root.pxar:/

Skript ausführbar machen.

chmod +x pbs-backup.sh

Testlauf (mit –dry-run)

./pbs-backup.sh
Starting backup: host/pi-matic/2024-07-01T22:05:11Z
Client name: pi-matic
Starting backup protocol: Tue Jul 2 00:05:11 2024
storing login ticket failed: $XDG_RUNTIME_DIR must be set
Downloading previous manifest (Tue Jul 2 00:00:00 2024)
Would upload directory '/' to 'backup@pbs@pbs.bachmann.lan:8007:SSD1-1TB' as root.pxar.didx
dry-run: no upload happened

Da ich aber nur /usr/local sichern möchte, wird alles excluded. (.pxarexclude kann in / nicht erstellt werden)

#!/bin/ash
export PBS_REPOSITORY=backup@pbs@pbs.bachmann.lan:SSD1-1TB
export PBS_PASSWORD=BACKUP-USER-PASSWORD
export PBS_FINGERPRINT="eb:ba:82:13:00:8b:28:aa:13:ca:51:cc:x9:f5:c3:1e:08:82:33:ca:43:38:75:a8:72:68:46:83:27:12:na:se"

cd /usr/local/pbs-client
./proxmox-backup-client.sh backup root.pxar:/ \
 --exclude /Image \
 --exclude /VERSION \
 --exclude /bin \
 --exclude /boot \
 --exclude /dev \
 --exclude /etc \
 --exclude /firmware \
 --exclude /lib \
 --exclude /lib32 \
 --exclude /lib64 \
 --exclude /libexec \
 --exclude lost+found \
 --exclude /linuxrc \
 --exclude /media \
 --exclude /mnt \
 --exclude /opt \
 --exclude /proc \
 --exclude /root \
 --exclude /run \
 --exclude /sbin \
 --exclude /share \
 --exclude /sys \
 --exclude tmp \
 --exclude /usr/lib \
 --exclude /usr/libexec \
 --exclude /usr/bin \
 --exclude /usr/etc \
 --exclude /usr/lib \
 --exclude /usr/lib32 \
 --exclude /usr/lib64 \
 --exclude /usr/sbin \
 --exclude /usr/share \
 --exclude /usr/local/etc \
 --exclude /usr/share \
 --exclude /var \
 --exclude /www \
 --exclude sdcard \
 --include-dev /usr/local

Backup

./pbs-backup.sh
Starting backup: host/pi-matic/2024-07-01T22:15:09Z
Client name: pi-matic
Starting backup protocol: Tue Jul  2 00:15:09 2024
storing login ticket failed: $XDG_RUNTIME_DIR must be set
No previous manifest available.
Upload directory '/' to 'backup@pbs@pbs.bachmann.lan:8007:SSD1-1TB' as root.pxar.didx
root.pxar: had to backup 32.566 MiB of 32.566 MiB (compressed 13.535 MiB) in 2.25s
root.pxar: average backup speed: 14.449 MiB/s
Uploaded backup catalog (3.053 KiB)
Duration: 2.34s
End Time: Tue Jul  2 00:15:12 2024

Passt, nur /usr/local im Backup.

crontab

Um das Backup zu automatisieren, wird ein cronjob erstellt. Benutzerdefinierte cronjobs kommen nach /usr/local/crontabs/root

# backup to pbs every day at 01:10
10 1 * * * /usr/local/pbs-client/pbs-backup.sh

crond service neu starten

/etc/init.d/S98crond restart
Stopping crond: OK
Starting crond: OK

test

crontab -l
*/11 * * * * [ -c /dev/rtc0 ] && /sbin/hwclock --systohc --utc
--- SNIP ---
# backup to pbs every day at 01:10
10 1 * * * /usr/local/pbs-client/pbs-backup.sh

Schreibe einen Kommentar