Skip to content

Instantly share code, notes, and snippets.

@andrewfraley
Last active April 20, 2024 08:20
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save andrewfraley/faa03abc70b7f2b1bd8ec95dc962ba5d to your computer and use it in GitHub Desktop.
Save andrewfraley/faa03abc70b7f2b1bd8ec95dc962ba5d to your computer and use it in GitHub Desktop.
Backup a Raspberry Pi to Proxmox Backup Server using the Proxmox Backup Client

Backup a Raspberry Pi to Proxmox Backup Server using the Proxmox Backup Client

This works on a Pi 4, and should work on a Pi 3, but to work on a Pi Zero you would have to figure out how to compile your own client. More info in this thread on the Proxmox forums.

Determine if your Pi is 32bit or 64bit

Run the following command. If you get arm64, it's 64bit, otherwise you'll see armv7l which is 32bit.

uname -m

Download a custom compiled version of the PBS client

Check for the latest release here. Then wget the PBS client, depending on if you need 32bit or 64bit.

wget https://github.com/ayufan/pve-backup-server-dockerfiles/releases/download/v1.1.9/proxmox-backup-client-v1.1.9-arm32v7.tgz

Extract the archive and move it to /usr/local/bin or wherever you'd like:

tar xvfz proxmox-backup-client-v1.1.9-arm32v7.tgz
mv proxmox-backup-client-v1.1.9 /usr/local/bin/pbs_client

Create a new script to do your backups at /usr/local/bin/pbs_backup.sh See the docs for more info on authentication:

#!/bin/bash

export PBS_REPOSITORY=pbs_client@pbs@pbs.local:mydatastore
export PBS_PASSWORD=mypassword
export PBS_FINGERPRINT="02:39:10:2d:23:59:5a:29:13:95:43:ad:d9:e7:d2:13:e5:f7:3e:fd:10:2e:38:9b:12:a3:1e:9e:4a:32:de:23"

apt clean cache
cd /usr/local/bin/pbs_backup
./proxmox-backup-client.sh backup root.pxar:/

Setup a cron job to do daily backups

Create /etc/cron.d/pbs_backup with:

# Run every day at 00:05
5 0 * * * root /usr/local/bin/pbs_backup.sh
@freakadell
Copy link

The backup works well, as far as I can see but how do I restore?

Just found this guide and set up my Pis to back up.
For restoring at first sight seems you only have the file tree backed up.
So probably like so - Burn new image of Raspbian, download from PBS the files, copy to the new Pi disk?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment