Skip to content

Instantly share code, notes, and snippets.

@andrewfraley
Last active April 18, 2025 05:23
Show Gist options
  • 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@[email protected]: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
@Paulie420
Copy link

Thanks a lot for this writeup... I was on the trail of finding pbs-client for ARM, but finding this helped out a lot!! I did use [some of] your script to make it much easier... I'm only running on a LOCAL IP, but I'll get that hostname setup some day.

Very much appreciate this... thanks kindly; now I can use my PBS for much more than only backing up PVE VMs. I'm about to give it the BIG test of about 14TB of backups. Again, thanks!

@Paulie420
Copy link

I'm getting an error. I'm trying to backup /export/Backup4TB from this Raspberry Pi NAS to my x86 PBS... it fails on the first file over 4GB; all drives are ext4, tho, so I'm confused:

Starting backup: host/SpeakerOffice/2022-07-13T15:43:34Z
Client name: SpeakerOffice
Starting backup protocol: Wed Jul 13 08:43:34 2022
Downloading previous manifest (Mon Jul 11 17:41:56 2022)
Upload directory '/export/Backup4TB' to 'x.x.x.x:PBS_backup' as root.pxar.didx
catalog upload error - channel closed
Error: stat failed on "SiriusXMFreeRadio.mp4": EOVERFLOW: Value too large for defined data type

You know, as if it were trying to send the file to an NTFS drive or something. I think this might be because the Pi is on Debian 10/buster and the PBS is on Debian 11/bullseye?? Any ideas?

@andrewfraley
Copy link
Author

This actually sounds like a 32bit issue, and if you google "EOVERFLOW: Value too large for defined data type" you'll get a lot of results for 32bit memory issues. I don't know if there's a workaround aside from using 64bit OS, maybe try the Proxmox/PBS forum.

@Paulie420
Copy link

I understand, andrewfraley - I saw the same info on a search... its weird, cause I can use proxmox-backup-client.sh to send a very small sub-directory... but once it hits a large file [6GB, I'm thinking the 4GB max NTFS???] but none of the drives are NTFS ; they are all, both remote and PBS, ext4. Weird... I'm on armv7l - am I correct in using the proxmox-backup-client-v2.1.5-arm32v7.tgz??

I'll post a question on the Proxmox/PBS forum ; this is a great tool, lol - I just hope I can get it w0rking for what I wanted to... backing up the huge NAS drives on this openmediavault machine. Heck, worst case I guess its just pushing me to move the NAS over to my PVE server... lol.

@rsyrnicki
Copy link

rsyrnicki commented Mar 22, 2023

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

@JeffBusch
Copy link

This was super helpful! Thanks for the write up 👍

@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?

@Jens-Wymeersch
Copy link

Some question from and comments

  • you indicate in the pbs_backup.sh - cd /usr/local/bin/pbs_backup however before you indicate to move it to ./pbs_client
  • when I bash pbs_backup, I'm getting the following error ./proxmox-backup-client.sh: 7: exec: /usr/local/bin/pbs_client/lib/ld-linux-*: not found
    I do see a file /usr/local/bin/pbs_client/lib/ld-linux.so.2

Can you please advise ?

@rsb-developer
Copy link

Thanks for this, very helpful, and works great.

@mpwhiten
Copy link

Thanks for this guide! Works perfectly for me.

I created an API access token and used that instead of having the raw password in the script. For anyone looking to do the same, it's located under Access Control in PBS. You need to create the API Token as well as the permissions to apply to the token.

@scyto
Copy link

scyto commented Apr 18, 2025

Thanks for this guide! Works perfectly for me.

I created an API access token and used that instead of having the raw password in the script. For anyone looking to do the same, it's located under Access Control in PBS. You need to create the API Token as well as the permissions to apply to the token.

Indeed i just came back to how to use pbsclient and found that 3 years ago that's what i did, was a little confused why it didn't work error 16, and then realized I had the v1 32 bit client installed on the pi, which was upgraded to 64 bit sometime in the last couple of years! changed client to lext 3.x 64bit and the script from 3 years ago still worked.

now to play with --change-detection-mode=metadata to speed it up and --include-dev /boot given on a pi how much we do there to configure the system....

--edit sometime later--
wow change detection mode is neat, made my second backup after adding it to the script 42s insead of 550s! (because so little had changed) this is my script showing me using the token for pam i created called pizave01

#!/bin/bash

export PBS_REPOSITORY=root@[email protected]:syn01.mydomain.com
export PBS_PASSWORD=redacted
export PBS_FINGERPRINT="dead:beef:dead:beef:dead:beef:dead:beef:dead:beef:dead:beef:dead:beef:dead:beef:dead:beef:"

apt clean cache
cd /usr/local/bin/pbs_client
./proxmox-backup-client.sh backup root.pxar:/ --include-dev /boot --change-detection-mode=metadata

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