Using proxmox-backup-client in script as PVE's GUI does

Sasha

Well-Known Member
Oct 18, 2018
88
1
48
Kazahstan
Hi guys!
I'm novice with PBS so in stuck with using proxmox-backup-client in my backup scripts.
Look, PVE's backup job is excellent, but i need to run the same activity backup in my script.
PVE's log of backing up to PBS is too complex for me and very unclear ((
Would You help me what command(s) I should use in script?

PVE's backup process log:

Code:
INFO: starting new backup job: vzdump 103 --node hq --notes-template '{{guestname}}' --remove 0 --mode snapshot --storage bs.domain.org
INFO: create storage snapshot 'vzdump'
INFO: creating Proxmox Backup Server archive 'ct/103/2023-12-29T09:04:12Z'
INFO: run: /usr/bin/proxmox-backup-client backup --crypt-mode=none pct.conf:/var/tmp/vzdumptmp2392261_103/etc/vzdump/pct.conf root.pxar:/mnt/vzsnap0 --include-dev /mnt/vzsnap0/./ --skip-lost-and-found --exclude=/tmp/?* --exclude=/var/tmp/?* --exclude=/var/run/?*.pid --backup-type ct --backup-id 103 --backup-time 1703840652 --repository root@pam@bs.domain.org:datastore --ns hq
INFO: Upload config file '/var/tmp/vzdumptmp2392261_103/etc/vzdump/pct.conf' to 'root@pam@bs.domain.org:8007:datastore' as pct.conf.blob
INFO: Upload directory '/mnt/vzsnap0' to 'root@pam@bs.domain.org:8007:datastore' as root.pxar.didx
 
Last edited:
It's not clear what you're asking. Are you trying to backup files that are not in Proxmox? Here is my bash script to backup my non-promox machine to PBS

Bash:
!/bin/bash

export PBS_REPOSITORY=root@pam@192.168.1.123:8007:pbs # Update the IP address and datastore name
export PBS_PASSWORD=supersecurerootpassword123
export PBS_FINGERPRINT=00:11:22:33:44:55:66:77:88:99:aa # Take from Configuration > Certificates > View Certificate > Fingerprint

#proxmox-backup-client backup etc.pxar:/etc opt.pxar:/opt home.pxar:/home root.pxar:/root varlibpvecluster.pxar:/var/lib/pve-cluster --include-dev /etc/pve
proxmox-backup-client backup etc.pxar:/etc opt.pxar:/opt home.pxar:/home root.pxar:/root --backup-id notebook
 
  • Like
Reactions: Sasha
I do appreciate You for answer. It was my second question!
My simple first question concerns containers (CT). In PVE GUI it's easy to backup it to PBS.
How to do it with proxmox-backup-client backup in command line?
PVE GUI uses command line too comlex for understanding...
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!