Check Out These Improved Proxmox Backup Client Helper Scripts

In previous posts, I have written about my Proxmox Backup client helper scripts and an Ansible role to provision them. The main limitation of the prior version of the scripts is that they could only specify one backup target file or directory. Now they can target multiple.

https://www.proxmox.com

Backup scripts improvements

The primary new feature is supporting multiple backup targets. In an older version of the scripts, you could only specify one target, like so:

PBS_BACKUP_DIR=/home/gonzo/postgres-data

This was fine for me while I only had one, simplistic arrangement on my servers. But now I have multiple directories I’d like to backup. I extended the scripts to use a format like this:

PBS_BACKUP_DIRS=/home/gonzo/postgres-data:/home/gonzo/mongo-data:/home/gonzo/service-data

Now each directory will be backed up as a separate target. If you view the backup in Proxmox Backup Server, you’d see separate
postgres-data, mongo-data, and service-data pxar files.

To maintain backward compatibility, both the PBS_BACKUP_DIR and PBS_BACKUP_DIRS (plural) environment variables are treated the same.

Environment example

Here is an example of what a complete set of environment variables looks like. Assume the following content is in a file sourced by your shell:


export PBS_BACKUP_DIRS=/home/gonzo/postgres-data:/home/gonzo/mongo-data:/home/gonzo/service-data
export PBS_BACKUP_NAME=pve-node3
export PBS_NAMESPACE=lake-house
export PBS_REPOSITORY=fletcher@pbs@fill-in-ip-for-pbs-server:pbs
export PBS_PASSWORD=fill-in-password-for-pbs-server

Ansible role improvements

The Ansible role should continue to work as effectively as it always has — use the pbc_scripts_backup_dirs variable to specify backup directories or files. (and once again, both singular and plural versions of this variable name should continue to work.)

There are a handful more variables that can be specified as well — like specifying a specific Proxmox Backup Client version, or what architecture you’d like to use (there is an ARM version available for, say, Raspberry Pi devices!)

Conclusion

Something we joke about with computing is that, it takes some work to go from zero to one (the initial version of these scripts), then more work to go from one to two (this new version that supports multiple backups), and then basically no work to go from two to n. In other words, one can now specify fifteen backup targets and it is no more effort than two.

And with that said, happy (multiple) backups!

Conversation

Join the conversation

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