PBS Client Api Token

anonymous_user0414

New Member
Nov 15, 2022
28
2
3
Hello,

i have problems to connect the pbs client with api token to the pbs server.

generally it works with the command:
proxmox-backup-client backup backup.pxar:/ --all-file-systems true --repository ip_pbs_server:data

then a password request follows, the backup is performed.

My target:
automate the backup command with a script with api token without pw request.

Steps so far:
on the server:
Token created, admin rights
user and token added to datastore as admin

at the client:
export PBS_PASSWORD=token secret
export PBS_REPOSITORY=testuser@pbs!token@ip_pbs_server:data
-> Error, event not found.

What am I doing wrong and where are the environment variables stored on the client?
 
Last edited:
Quote the string, like PBS_REPOSITORY='testuser@pbs!token@ip:data'
 
In your environment. I'm not sure I understand the question.

You can write it like PBS_PASSWORD=123 PBS_REPOSITORY='...' proxmox-backup-client backup.pxar and so on.
Just place it in the script you run the backup with
 
Last edited:
  • Like
Reactions: Max Carrara
there is the export function.

export PBS_REPOSITORY=...
so i can omit this in the actual command

proxmox-backup-client backup backup.pxar:/ ...

so the client already knows the server.

Now I'm wondering where this information is stored.... somewhere in /etc/?
 
And where are the environment variables stored?
You can see all of your environment variables by calling the env command. They're just stored in your current shell session or your current script.

What @Matthias. suggested...
Just place it in the script you run the backup with
... is the easiest way to do it, that way your variables don't "leak" into sub-shells.


there is the export function.

export PBS_REPOSITORY=...
so i can omit this in the actual command
Yes, you can do that, but I wouldn't recommend doing that for sensitive information, e.g. passwords. Every program / script you then run will receive those exported variables, and I think it's obvious that you don't want that to happen with passwords. ;)

Now I'm wondering where this information is stored.... somewhere in /etc/?
The environment variables that are currently in use for a given process $PID are stored in /proc/${PID}/environ. Only root can read those.
 

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!