Try My Helper Scripts for Running Proxmox Backup Client

Proxmox Backup Client is a tool for backing up an arbitrary directory on a file system to a Proxmox Backup Server instance. The proxmox-backup-client utility takes a handful of parameters that are not trivial to use, so I’ve created and published a handful of helper scripts to run it.

Proxmox logo

About Proxmox Backup Client

While Proxmox Backup Server is generally intended for creating and managing backups of Proxmox Virtual Environment virtual machines, the Proxmox Backup Client can be used for capturing data directly off of a filesystem. It’s handy for backing up data off of systems not within your Proxmox ecosystem, backing up the /etc directory of your Proxmox systems, or for subsets of your filesystem that are easier to restore than an entire virtual machine.

Client installation is straightforward on Debian and Ubuntu derivates. And manual installation is available for other platforms.

My Helper Scripts

Since the `proxmox-backup-client` application takes a handful of parameters or environment variables, I’ve created a handful of shell scripts to ease running it.

My scripts and setup instructions are available in this GitHub repository.

General Workflow

Day-to-day I typically run backup-to-pbs.sh to grab a new backup of my target directory. If I need to restore something, I use a combination of list-pbs-snapshots.sh to list my backups and then restore-pbs-backup.sh to restore one.

All three of the above scripts use a helper script named pbs-environment.sh. This script ensures the required PBS_BACKUP_NAME, PBS_BACKUP_DIR, PBS_NAMESPACE, and PBS_REPOSITORY environments variables are set. PBS_PASSWORD may also be set for convenience.

Example

Here is an example workflow on my system foo.

List snapshots

fletcher@foo:~/runtime$ ./list-pbs-snapshots.sh
┌───────────────────────────────────┬─────────────┬─────────────────────────────────────┐
│ snapshot                          │        size │ files                               │
╞═══════════════════════════════════╪═════════════╪═════════════════════════════════════╡
│ host/foo/2023-03-15T01:52:01Z     │ 624.036 MiB │ catalog.pcat1 index.json delta.pxar │
├───────────────────────────────────┼─────────────┼─────────────────────────────────────┤
│ host/foo/2023-03-29T18:20:50Z     │ 156.278 MiB │ catalog.pcat1 index.json delta.pxar │
├───────────────────────────────────┼─────────────┼─────────────────────────────────────┤

Take a new snapshot

fletcher@foo:~/runtime$ ./backup-to-pbs.sh
Starting backup: [bar]:host/foo/2023-04-03T14:23:06Z
Client name: foo
Starting backup protocol: Mon Apr  3 10:23:06 2023
Downloading previous manifest (Wed Mar 30 09:29:26 2023)
Upload directory '/home/fletcher/runtime/config' to 'baz@[email protected]:8007:gamma' as delta.pxar.didx
delta.pxar: had to backup 153.483 MiB of 364.302 MiB (compressed 14.452 MiB) in 1.51s
delta.pxar: average backup speed: 101.733 MiB/s
delta.pxar: backup was done incrementally, reused 210.819 MiB (57.9%)
Uploaded backup catalog (3.442 KiB)
Duration: 1.60s
End Time: Mon Apr  3 10:23:08 2023

See the new snapshot in the list

fletcher@foo:~/runtime$ ./list-pbs-snapshots.sh
┌───────────────────────────────────┬─────────────┬─────────────────────────────────────┐
│ snapshot                          │        size │ files                               │
╞═══════════════════════════════════╪═════════════╪═════════════════════════════════════╡
│ host/foo/2023-03-15T01:52:01Z     │ 624.036 MiB │ catalog.pcat1 index.json delta.pxar │
├───────────────────────────────────┼─────────────┼─────────────────────────────────────┤
│ host/foo/2023-03-29T18:20:50Z     │ 156.278 MiB │ catalog.pcat1 index.json delta.pxar │
├───────────────────────────────────┼─────────────┼─────────────────────────────────────┤
| host/foo/2023-04-03T14:23:06Z     │ 364.306 MiB │ catalog.pcat1 index.json delta.pxar │
└───────────────────────────────────┴─────────────┴─────────────────────────────────────┘

Restore a snapshot

fletcher@foo:~/runtime$ ./restore-pbs-backup.sh host/foo/2023-03-29T18:20:50Z

There is no output from the restore command. Assuming it worked, that directory will be restored as it was when the specified backup was taken.

Using These Scripts Yourself

My scripts and setup instructions are available in this GitHub repository. Feel free to download and modify as you see fit.

Thanks to the Proxmox team for making the Proxmox Backup Client tool available. I could, of course, do all of these backups by hand. But, I appreciate that my host backups can be part of my Proxmox Backup Server just like all of my virtual machine backups. And, in turn, all of my Backup Server content is backed up to Backblaze B2 every night.

Lastly, thanks to Jay from Learn Linux TV for making me aware of Proxmox Backup CLient as part of his Proxmox Full Course series.

Conversation

Join the conversation

Your email address will not be published. Required fields are marked *